Thread: Next Blank Row
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Next Blank Row

Try this. It will select the first cell in the first row that is totally
empty:

Sub Macro1()
Dim j As Long
Dim i As Long
Dim r, rr As Range
Set rr = ActiveSheet.UsedRange

j = rr.Rows.Count + rr.Row
For i = 1 To j
If Application.CountA(Rows(i)) = 0 Then
Cells(i, 1).Select
Exit Sub
End If
Next i
End Sub

--
Gary''s Student


"Sheldon" wrote:

That's great help Jim. How can I get this to look at columns A-Q?

"Jim Thomlinson" wrote:

With Sheets("Sheet1")
.select
.cells(rows.count, "A").end(xlup).offset(1,0).select
end with

This will select the first blank row looking at the items in column A...
--
HTH...

Jim Thomlinson


"Sheldon" wrote:

I'm writing a Macro that copies information from several worksheets to one
worksheet and I need the next block of data to be pasted in the first row
that is empty. Can someone help me with some VB code that will select a cell
in the first empty row?

Thanks for any assistance.