Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump to first row where a cell contains a certain text

Tags:

excel

vba

I have a spreadsheet where I've found some code that jumps to the first empty row:

 lastRowA = Range("A" & Rows.Count).End(xlUp).Row + 1
 ActiveWorkbook.Worksheets("RO input sheet").Range("A" & lastRowA).Select

My problem is that the conditions surrounding the spreadsheet have changed so now I need to tweak the code so it jumps to the first row where cell A contains a specific text, for instance "Test123".

How can I do this in VBA?

like image 377
Morten Laustsen Avatar asked Sep 17 '13 09:09

Morten Laustsen


1 Answers

Replace the entire code with simply:

ActiveWorkbook.Worksheets("RO input sheet").Columns(1).Find("Test123").Select
like image 98
mattboy Avatar answered Sep 21 '22 07:09

mattboy