[英]EXCEL VBA to select ROWS if Cell A5 contains specific text - caveats
I receive an excel file daily.我每天都会收到一份 excel 文件。 I am trying to select all ROWS if cells from A5 to the end of the dynamic data contains a string "TURNER 232"
如果从 A5 到动态数据末尾的单元格包含字符串“TURNER 232”,我正在尝试 select 所有 ROWS
I have been copying various examples of code from this website to no avail.我一直在从该网站复制各种代码示例,但无济于事。
Would appreciate any assistance if possible.如果可能的话,将不胜感激。
Many thanks Matt非常感谢马特
Code used使用的代码
Sub CustomSelect()
Dim i As Long: i = 2
Do While Range("H" & i).Value = "TURNER 232"
i = i + 1
Loop
Range("A5:H" & i - 1).EntireRow.Select
End Sub
Scott,斯科特,
I used the below which did the trick.我使用了下面的方法。
Thanks mate.1st ever soiree into VBA感谢伙伴。第一次参加 VBA 的晚会
Sub CustomSelect()
Dim i As Long: i = 5
Do While Range("A" & i).Value = "TURNER 232"
i = i + 1
Loop
Range("A5:A" & i - 1).EntireRow.Select
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.