Go to first available cell in A.

  • Thread starter Thread starter J.W. Aldridge
  • Start date Start date
J

J.W. Aldridge

Simple, but having the hardest time...

Need to go to first available cell in column A, then clear contents of
all columns to the right and rows below.

(Thought I was getting good at this, but got stuck assembling this one
for some reason).
 
Define more clearly what you mean by 'First available cell in Column A'

Good point Mike

This will select the first empty cell in A
This is not always the cell below the last cell with data in A

Sub test()
On Error GoTo BodemUp
Columns("A").Cells.SpecialCells(xlCellTypeBlanks).Cells(1).Select
Exit Sub
BodemUp: Cells(Rows.Count, "A").End(xlUp)(2).Select
End Sub
 
This one takes me to the last cell used.
I need the cursor to go to the next empty cell.
Then clear everything to the right and below.

Range("A2").Select
Selection.End(xlDown).Select
 
Hi,

In which case it sounds like you want this

FirstRow = Range("A2").End(xlDown).Row
lastrow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row
Rows(FirstRow & ":" & lastrow).EntireRow.ClearContents


Mike
 
Back
Top