I’m having an issue where the macro is deleting the entire column if the first row is empty. Is there any way of finding the first available row with data? I’m assuming the issue is with naming “A2” as the range?
Sub PrepForUpload()
Dim rowNumber As Integer
Sheets("Initiatives").Select
ActiveSheet.Range("a2").Select
While (Range(ActiveCell, ActiveCell.Offset(0, 0)) <> "")
ActiveCell.Offset(1, 0).Select
Wend
rowNumber = ActiveCell.Row
ActiveSheet.Range(rowNumber & ":65536").Select
Selection.Clear
Range("A2").Select
ActiveWorkbook.Save
End Sub
Any help would be great
Thanks
Having the select makes your macro slower. If you’re trying to to clear everything after the last filled A cell, try this instead