Hi all
I am using the following code to insert two new columns and then put the weeknum and L2 in each, and then delete an unwanted cell, my question is that my data sped changes each week this week it had 198 next week it may only be 180 or 80 how do i change the code so it only goes as far as whats in cells C.
I am new to this and trying to learn as i go so any help would be good.
Thanks you.
Sub Line2()
'
' Line2 Macro
'
'
Columns("A:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A2").Select
ActiveCell.FormulaR1C1 = "=WEEKNUM(RC[2])"
Range("A2").Select
Selection.AutoFill Destination:=Range("A2:A198"), Type:=xlFillDefault
Range("A2:A198").Select
ActiveWindow.SmallScroll Down:=-219
Range("B2").Select
ActiveCell.FormulaR1C1 = "L2"
Selection.AutoFill Destination:=Range("B2:B198"), Type:=xlFillCopy
Range("B2:B198").Select
ActiveWindow.SmallScroll Down:=-18
Columns("F:F").Select
Selection.Delete Shift:=xlToLeft
End Sub
Bookmarks