Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
first empty cell
starting at A3 i need to return the first cell that is empty. i tried: Row = 3 While IsEmpty("A" & Row) = False Row = Row + 1 Wend but i get a overflow error that selects "row=row+1" i found the following code somewhere else, but this won't work. the sheet i'm using is setup as a list. so the last line of the list says "total." since the following looks from the bottom up, it does not go to possible empty cells above that. code: Sub FindLastCell() Dim LastCell As Range With ActiveSheet Set LastCell = .Cells(.Rows.Count, "A").End(xlUp) If IsEmpty(LastCell) Then 'do nothing Else Set LastCell = LastCell.Offset(1, 0) End If End With MsgBox LastCell.Row End Sub -- TheIrishThug ------------------------------------------------------------------------ TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682 View this thread: http://www.excelforum.com/showthread...hreadid=494788 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When is a cell empty and how do I empty it. | Excel Discussion (Misc queries) | |||
Leaving an empty cell empty | Excel Discussion (Misc queries) | |||
why a reference to an empty cell is not considered empty | Excel Discussion (Misc queries) | |||
Empty cell and a the empty String | Excel Programming | |||
VBA to copy to empty cell directly below a cell when analogous cells in different column have same value as each other? | Excel Programming |