![](/img/trans.png)
[英]How to check if the actual text in the cell already exists in the column in excel
[英]How to check if an element exists in a column, and then insert a square with text in a certain cell
尝试使用它,我将列表的同一张表格的单元格A20与我的“要检查的输入值”地址一起使用,您可以在Cells(20, 1)
上立即对其进行更改
Sub createDataShapes()
Dim rng As Range
Dim shp, rect As Shape
Set rng = ThisWorkbook.ActiveSheet.Range("A1").CurrentRegion.Find(ThisWorkbook.ActiveSheet.Cells(20, 1).Value)
If Not IsNull(rng.Value) Then
For Each shp In ThisWorkbook.ActiveSheet.Shapes
shp.Delete
Next shp
ThisWorkbook.ActiveSheet.Shapes.AddShape msoShapeRectangle, 100, 100, 100, 100
Set rect = ThisWorkbook.ActiveSheet.Shapes(1)
rect.TextFrame.Characters.Text = rng.Value
End If
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.