R
Rick S.
I am trying to figure out how to number cells in a range in a numerical
ascending order. By recording a macro I can see how its done on one sheet.
'=====
Range("A6").Select
ActiveCell.FormulaR1C1 = "1"
Selection.AutoFill Destination:=Range("A6:A26"), Type:=xlFillDefault
'=====
If I change ActiveCell.FormulaR1C1 = "1" to ActiveCell.FormulaR1C1 = MyVar
the numbering sequence stops and only repeats the value of MyVar in each
cell. The reason I need a variable is I wont know the number of sheets in
the workbook and I need to number the cells 1 thru 21 and adding 21 for each
sheet to continue numbering.
--
Regards
Rick
XP Pro
Office 2007
ascending order. By recording a macro I can see how its done on one sheet.
'=====
Range("A6").Select
ActiveCell.FormulaR1C1 = "1"
Selection.AutoFill Destination:=Range("A6:A26"), Type:=xlFillDefault
'=====
If I change ActiveCell.FormulaR1C1 = "1" to ActiveCell.FormulaR1C1 = MyVar
the numbering sequence stops and only repeats the value of MyVar in each
cell. The reason I need a variable is I wont know the number of sheets in
the workbook and I need to number the cells 1 thru 21 and adding 21 for each
sheet to continue numbering.
--
Regards
Rick
XP Pro
Office 2007