Go to first available cell in A.

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).
 
R

Ron de Bruin

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
 
J

J.W. Aldridge

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
 
M

Mike H

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top