I have two macros which independently work. I want to nest one within the other.
I receive a recurring file that has a couple of rows of sporadic footers on the bottom of them. I need to remove these footers. The number of rows in each file varies, but there is always an empty row between the end of the data and the footer.
The first macro finds the empty row by looking in column A
Sub FTPstep2()
'
' FTPstep2 Macro
'
'
If Application.WorksheetFunction.CountA("A:A") = 0 Then
[A1].Select
Else
On Error Resume Next
Columns(1).SpecialCells(xlCellTypeBlanks)(1, 1).Select
If Err <> 0 Then
On Error GoTo 0
[A65536].End(xlUp)(2, 1).Select
End If
On Error GoTo 0
End If
End Sub
The second macro deletes everything below row "X"
Sub FTPstep3()
'
' FTPstep3 Macro
'
With Sheets("Sheet1")
.Rows( X & ":" & .Rows.Count).Delete
End With
End Sub
I'd like to nest the first macro (FTPstep2) where the "X" is in the second macro (FTPstep3). I've tried a variety of routes but it tends to not like the ampersand or expects end statements, etc.