Hi Bob
I wanted to add a sub routine to an existing macro to automate the 12 recurring process, your method is manual.
In xl2007 I can use xlFillCopy which would do the job, but xl2004 for Mac does not support xlFillCopy.
My mention of the column R refers to using a contiguous column of data to tell the FillDown Destination to stop at the last cell in column R containing data.
Example:-
Range("B1:B2").Copy
Range("Q3").AutoFill Destination:=Range("Q3:Q" & Range("R65536").End(xlUp).Row)
' The above code will not enter 121212 down column Q
I received a reply from a Rick Rothstein with attached code as below.
It requires a helper cell at the moment to work.
Should I enter the code as a reply to my own question?
Sub InsertOnesAndTwos()
''' This macro working ok in DVD Collection.xls (SEE the comment on the For statement first)...
Dim X As Long
With Application
..ScreenUpdating = False
..Calculation = xlCalculationManual
''' ===============================================================
''' Enters #1 in cell Q3 and #2 in cell Q4 recurring down to last cell in column R.
''' Requires helper cell Q1 to count Non blank contiguous cells in column R.
''' Q1 contains formula =COUNTA(R:R)
''' ===============================================================
For X = 3 To Range("Q1")
Cells(X, "Q").Value = 1 + (Cells(X - 1, "Q").Value Mod 2) ' counts down from row 1 making row 3 a 1
Next
..Calculation = xlCalculationAutomatic
..ScreenUpdating = True
End With
End Sub
Cheers
Bob C