Hi All,
Can you please help me by adjusting this VBA for autofill until empty and not until cell "C346"?
Thank you very much!!
' Keyboard Shortcut: Ctrl+y
'
Columns("A:A").Select
Selection.ColumnWidth = 8.57
Columns("A:A").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Columns("C:G").Select
Selection.Delete Shift:=xlToLeft
Columns("H:AK").Select
Selection.Delete Shift:=xlToLeft
Columns("F:F").Select
Selection.Delete Shift:=xlToLeft
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C1").Select
ActiveCell.FormulaR1C1 = "PM"
Range("D1").Select
ActiveCell.FormulaR1C1 = "PT"
Range("C2").Select
Sheets("INV View").Select
Sheets("Data").Visible = True
Sheets("INV View").Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Data!C[-2]:C[-1],2,FALSE)"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C346")
Range("C2:C346").Select
Range("D2").Select
End Sub
Can you please help me by adjusting this VBA for autofill until empty and not until cell "C346"?
Thank you very much!!
' Keyboard Shortcut: Ctrl+y
'
Columns("A:A").Select
Selection.ColumnWidth = 8.57
Columns("A:A").EntireColumn.AutoFit
Columns("B:B").EntireColumn.AutoFit
Columns("C:G").Select
Selection.Delete Shift:=xlToLeft
Columns("H:AK").Select
Selection.Delete Shift:=xlToLeft
Columns("F:F").Select
Selection.Delete Shift:=xlToLeft
Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("C1").Select
ActiveCell.FormulaR1C1 = "PM"
Range("D1").Select
ActiveCell.FormulaR1C1 = "PT"
Range("C2").Select
Sheets("INV View").Select
Sheets("Data").Visible = True
Sheets("INV View").Select
Range("C2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-2],Data!C[-2]:C[-1],2,FALSE)"
Range("C2").Select
Selection.AutoFill Destination:=Range("C2:C346")
Range("C2:C346").Select
Range("D2").Select
End Sub