i have a macro that takes a text file and layes out an invoice summary. in that new file i want the following macro
Sub Delete_Memo_Lines()
Dim NoRows As Long
Dim I As Long
Dim rng As Range
Application.ScreenUpdating = False
NoRows = Range("A65536").End(xlUp).Row
For I = NoRows To 1 Step -1
Set rng = Range("D" & I)
If UCase(rng.Value) = "M" Then
rng.EntireRow.Delete
End If
Next I
Application.ScreenUpdating = True
End Sub
is there a way to add this code to the original macro, so when it create's the new file it automatically inserts this macro into it?
Sub Delete_Memo_Lines()
Dim NoRows As Long
Dim I As Long
Dim rng As Range
Application.ScreenUpdating = False
NoRows = Range("A65536").End(xlUp).Row
For I = NoRows To 1 Step -1
Set rng = Range("D" & I)
If UCase(rng.Value) = "M" Then
rng.EntireRow.Delete
End If
Next I
Application.ScreenUpdating = True
End Sub
is there a way to add this code to the original macro, so when it create's the new file it automatically inserts this macro into it?