pcorcele said:
I would like a macro that will find the first empty line under col A:
I would also like that macro to activate as soon as the Excel file is
opened.
Depends on what you mean by "first empty line".
If you mean "the line under the bottom used row", put this in the workbook's
ThisWorkbook object:
Private Sub Workbook_Open()
Cells(Cells.SpecialCells(xlCellTypeLastCell).Row + 1, 1).Select
End Sub
If you mean "the first line that happens to have nothing in it", use this
instead:
Private Sub Workbook_Open()
For x = 1 To Cells.SpecialCells(xlCellTypeLastCell).Row
For y = 1 To Cells.SpecialCells(xlCellTypeLastCell).Column
If Len(Cells(x, y).Formula) Then GoTo notEmpty
Next
'this is what we want
Cells(x, 1).Select
Exit Sub
notEmpty:
Next
Cells(Cells.SpecialCells(xlCellTypeLastCell).Row + 1, 1).Select
End Sub
If you mean *anything else*, you'll need to clarify.