[英]Finding position of a particular string containing cell in Excel
I am searching for a string using below code 我正在使用以下代码搜索字符串
For x = 2 To lastrow
If Sheets("sheet1").Cells(x, 3) = TFMODE Then
.......
'TFMODE is the string discussed
'This particular string "TFMODE" is randomly recurring throughout
'sheet in column 3.
I need to know position for a particular string in sheet1 Then autofill data which is beneath that string position in sheet2 我需要知道sheet1中特定字符串的位置,然后自动填充sheet2中该字符串位置下方的数据
One way: 单程:
Sub qwerty()
lastrow = 10
For x = 2 To lastrow
If InStr(Sheets("Sheet1").Cells(x, 3), "TFMODE") > 0 Then
MsgBox Sheets("Sheet1").Cells(x, 3).Address(0, 0)
End If
Next x
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.