I have a pretty easy and quick question. I'm trying to write a macro that copies the last row in a spreadsheet, and then pastes the last row. This will be used for an "Add New Record" button that I am assigning the macro to. the idea is that if the last row is always a "blank row" that has the formulas, then as long as the user hits the "Add New Record" button, the formulas will be in the row for the New Record.
Here's what I have now:
Sub test()
'
' test Macro
' Macro recorded 4/10/2002 by Ryan M. Cavaliere
'
'
Sheets("Env Site Assessments").Select
ActiveCell.SpecialCells(xlLastCell).Select
Rows("49:49").Select
Application.CutCopyMode = False
Selection.Copy
Selection.Insert Shift:=xlDown
End Sub
The problem is that Row 49 is being copied, not the last row. I just need to know the correct syntax to select the last row. I thought it was xlLastRow, but that doesn't seem to work.
If someone could take a minute to answer this email, it would be greatly appreciated.
Thanks!
Ryan Cavaliere
Here's what I have now:
Sub test()
'
' test Macro
' Macro recorded 4/10/2002 by Ryan M. Cavaliere
'
'
Sheets("Env Site Assessments").Select
ActiveCell.SpecialCells(xlLastCell).Select
Rows("49:49").Select
Application.CutCopyMode = False
Selection.Copy
Selection.Insert Shift:=xlDown
End Sub
The problem is that Row 49 is being copied, not the last row. I just need to know the correct syntax to select the last row. I thought it was xlLastRow, but that doesn't seem to work.
If someone could take a minute to answer this email, it would be greatly appreciated.
Thanks!
Ryan Cavaliere