View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MechEng MechEng is offline
external usenet poster
 
Posts: 5
Default Macro to add row with sequential numbers

I just recorded the macro by copiying the lines and inserted copied cells,
the following code was created:

Sub Add_Week()
ActiveCell.Offset(-11, 0).Rows("1:2").EntireRow.Select
Selection.Copy
ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
ActiveSheet.Paste
ActiveCell.Offset(2, 0).Rows("1:1").EntireRow.Select
ActiveSheet.Paste
ActiveCell.Offset(2, 0).Range("A1").Select
Application.CutCopyMode = False
End Sub


"bj" wrote:

what are the appropriate lines in the macro you use?

"MechEng" wrote:

I am trying too create a macro that will add rows that have a sequential
number assigned to them.

The finish product has an "add row" button that copies weeks and adds them
to the bottom of the sheet with an assigned number (i.e. Week 1, Week 2,
ect.).

I was able to add the rows with a macro that, copies and inserts row, but
cannot get the numbering to remain relative. (Even with relative reference
picked).

If anyone can help me out it would be much appreciated.