You should run this type of code from a module not a from a Sheet-Tab, View Code macro.
Also, try : Range("B65536").End(xlUp).Select
Where, "B" is the column you want to look for data in. The code moves up from the bottom to the first ROW it finds data in and selects it. You must then do something with it?
The code above will in affect give you the last ROW that has data. This code works well if you know that the data you are looking for will be in a known COLUMN?
The loop code from your test code is slow, if the above condition is known. If you don't know what COLUMN your data will be in then the loop is as good as any?
You could modify the code to look for the ROW ADDRESS of the first found data cell going up as well and Select it? JSW
I want to find the last cell in a row not in a column
Try: myRange.End(xlToLeft).Select
where "myRange" is the range you want to check. The other code works, it gives you the first ROW from the bottom that has data, if you know the column?
Do you want the Column from "IV" to "A" that has data in a Row?
Or, Do you want to select the cell which has the highest Row number in a Column, whos cell has data?
Or, Do you want to select the Right most column that has a Row cell with data?
Or, Do you want to select the bottom Row with data regardless of Column?
Your Msg is un-clear? JSW
I was having a problem because I was using xlleft
instead of xltoleft
I am good now Try: myRange.End(xlToLeft).Select