I have 0 in cell G1 and need to autofill with 0s till the last used row.
In the below code the 0s are updating till row 30 while my rows are only filled till row 4.
I want the 0s to fill only if there's data in the adjacent row.
NumberConv is Sheet2 in my workbook.
Sub MacroNC
Sheets("NumberConv").Select
Range("G1").Select
Selection.NumberFormat = "@"
ActiveCell.FormulaR1C1 = "0"
Sheet2.Select
Range("G1").Select
lastRow = ActiveSheet.UsedRange.Rows.Count
Selection.AutoFill Destination:=Range("G1:G" & lastRow), Type:=xlFillCopy
End Sub