Hello Ada,
I tried the above code with no success. My first empty row on this paticular report is 5425, but the code takes me to "A2" everytime. There is data in "A2:A5424". I even copied and pasted the code just in case my typing was the problem. Any ideas what I could be doing wrong?
Best regards,
Mike
Mike,
Try this line in a procedure:
FirstEmptyRow = Range("A65000").End(xlUp).Row + 1
Hope this helps,
Ryan
I've found the following works rather well. You end up with a variable (CellA) that tells you the first empty cell. This only drills down the A column. It can be easily modified to write all the empty cells in a column to an array.
Dim Cntr, CellA
Cntr = 1
Range("A1").Select
Do While ActiveCell <> ""
Cntr = Cntr + 1
CellA = "A" & Cntr
Range(CellA).Select
Loop
Problem has been solved. Thanks to everyone for their time, help, and patience.
Best regards,
Mike
Mike
Sorry, I should have tested the code I posted.
Also, the suggestions from Toby and Ryan do not necessarily take you to the cell in column A of the first empty row (since there might be data in lower rows in other columns).
This should do it (I hope):-
firstEmptyRow = ActiveSheet.UsedRange.Cells(ActiveSheet.UsedRange.Cells.Count).Offset(1, 0).Row
Set firstEmptyCell = Range("A" & firstEmptyRow)
firstEmptyCell.Select
Ada
Than you in advance for any assistance. Mike
Mike
FirstEmptyRow = ActiveSheet.UsedRange.Row+1
Set FirstEmptyCell = Cells(FirstEmptyRow, 1)
FirstEmptyCell.Select
Ada