First blank row

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
1,708
I have this but it isn't working
VBA Code:
Function FirstBlankRow(Sheet)
    With Worksheets(Sheet)
        FirstBlankRow = .Cells.SpecialCells(xlCellTypeLastCell).offset(1, 0).Row
    End With
End Function

It returns a 3 when the first blank row is 2. It need not look past Column "A" either, so first blank "A" would do.
 

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,470
Office Version
  1. 2013
Platform
  1. Windows
Try using
VBA Code:
FirstBlankRow = .Range("A:A").SpecialCells(xlCellTypeLastCell).Offset(1, 0).Row
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,470
Office Version
  1. 2013
Platform
  1. Windows
Easier
VBA Code:
FirstBlankRow =.Cells(Rows.Count, "A").End(xlUp).Row + 1
 

Watch MrExcel Video

Forum statistics

Threads
1,118,521
Messages
5,572,628
Members
412,475
Latest member
JaredNAU
Top