因为标题说我正在尝试搜索Col C并且是否找到了文本/数字,然后将文本从另一个单元格移动到Col D
所以更简单地说吧
EG:C10中有一些文字 - 所以我想将文字从I8复制到D10(新数据总是两行和第一集)
我一直在玩这个VBA代码
Dim find As String
Dim findcell As Range
FindString = "*"
'Not sure how to find anything - But if I put a string that actually is in the sheet then it moves the example same one to Col D
For Each findcell In Range(ActiveSheet.Range("C1"), ActiveSheet.Range("C250").End(xlUp)).Cells
If InStr(findcell, FindString) > 0 Then findcell.Offset(, 1) = FindString
Next findcell
非常感谢任何帮助/建议
答案 0 :(得分:0)
试试这个:
Dim findcell As Range
For Each findcell In Range(ActiveSheet.Range("C3"), ActiveSheet.Range("C250").End(xlUp)).Cells
If Len(findcell) > 0 Then findcell.Offset(0, 1) = findcell.Offset(-2, 6)
Next findcell
但当然,这只会在第3行及以后开始工作,因为你说新数据总是两行。