Hello,
the macro below autofills cells in column with the name above if the cell is blank. The code works well but doesnt stop with column A. for some reason it goes into Column B.
Can anyone correct the code please
Sub Autofill()
ActiveSheet.Columns("A:A").Select
Selection.Unmerge
ActiveSheet.Outline.ShowLevels RowLevels:=2
With Range(Range("A"), Cells(Rows.Count, 3).End(xlUp).Offset(, -1))
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
.Value = .Value
End With
End Sub
the macro below autofills cells in column with the name above if the cell is blank. The code works well but doesnt stop with column A. for some reason it goes into Column B.
Can anyone correct the code please
Sub Autofill()
ActiveSheet.Columns("A:A").Select
Selection.Unmerge
ActiveSheet.Outline.ShowLevels RowLevels:=2
With Range(Range("A"), Cells(Rows.Count, 3).End(xlUp).Offset(, -1))
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
.Value = .Value
End With
End Sub