The following code will format my template correctly the way I want. However, in the event the template is empty and a user hits the prep upload button on the sheet, I will receive an Overflow Error 6. Is there any way to remove what is causing this error?
Sub PrepForUpload()
Dim cel As Range, rng As Range
Set rng = Range("A2", Range("A65536").End(xlUp))
For Each cel In rng
If cel.Value = "" Then
If cel.Offset(, 2).Value = "" Then
cel.EntireRow.Delete
End If
End If
Next cel
Dim rowNumber As Integer
With Sheets("Initiatives")
If Len(.Cells(2, 1)) = 0 Then
rowNumber = .Cells(2, 1).End(xlDown).End(xlDown).Row + 1
Else: rowNumber = .Cells(2, 1).End(xlDown).Row + 1
End If
.Rows(rowNumber & ":" & .Rows.Count).Clear
End With
End Sub
Debug points to the following line as the issue:
rowNumber = .Cells(2, 1).End(xlDown).End(xlDown).Row + 1
Thanks
Ryan
endtwice?