find next unused row

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi
iam new to Visual Basic. I have a macro that performs some
calculations and outputs the results into excel 2000.
how do i make visual basic put the results in the next unused row
whenever the macro is run.
please post any links if this might have been explained before.

Thanks

Mike
 
Formula (Array - Ctrl-Shift-Enter

= ADDRESS(ROW(OFFSET( $A$1,COUNTA($A$1:$A$65000),0)),COLUMN(OFFSET(
$A$1,COUNTA( $A$1:$A$65000),0)))

or
Macro:

Sub NextBlankDown()
Range("a1").Activate
If ActiveCell.End(xlDown).Row = Rows.Count Then Exit Sub
MsgBox (ActiveCell.End(xlDown).Offset(1, 0).Address)
End Sub

Don Pistulka
 
Mike,

This macro takes the entire first row on the active sheet and copies it to
the first blank row on sheet2.

Sub test1()
Cells(1, 1).EntireRow.Copy
Destination:=Sheets("sheet2").Range("a65536").End(xlUp).Offset(1, 0)
End Sub

Don Pistulka
 

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

Back
Top