I have the following macro in Excel
Sub IHIAddWeeks()
'
' IHIAddWeeks Macro
' ihi-table
'
' Keyboard Shortcut: Ctrl+Shift+I
'
ActiveCell.FormulaR1C1 = "=YEAR(RC[1])&WEEKNUM((RC[1]))"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A5"), Type:=xlFillDefault
End Sub
After It looks like:
Now I AutoFill until A5 because A5 is the last nonempty raw. But this can change. How can I say : "AutoFill it until the last nonempty B column" ?
At next I like to insert a raw after A2 if A3>A2+1 and let the new A3=A2+1, and then compare A3 with A4 and so on until the B column is blank.
Can one help?
in the end table should look like this