Hi can you help me please to identify what is wrong with my code (it doesn't do anything).
I'm not proficient with excel terms.
I'm not proficient with excel terms.
Code:
Sub FillEveryOtherColumn()
Dim lastCell As Integer
Dim lastColumn As Integer
Dim i As Integer
Dim End1 As Integer
Dim Start2 As Integer
Dim End2 As Integer
Application.ScreenUpdating = False
'Find last populated column after Column G
lastCell = Range("G1").End(xlToRight).Column
'Calculate the number of Columns you'll need to fill
lastColumn = (lastCell / 2) + 1
'Find last populated row in first half of column (58 rows before the end)
End1 = Cells(Rows.Count, "A").End(xlUp).Row - 58
'Find first populated row in 2nd half of column (41 rows before the end
Start2 = End1 - 41
'Find last populated row
End2 = Cells(Rows.Count, "A").End(xlUp).Row
'Start with Column G (Column 7), and fill every other column
For i = 7 To lastColumn Step 1
Range(Cells(7, i), Cells(End1, i)).Select
Selection.FillDown
Range(Cells(Start2, i), Cells(End2, i)).Select
Selection.FillDown
Next i
Application.ScreenUpdating = True
End Sub