Use module globally

  • Thread starter Thread starter chrissy2391
  • Start date Start date
C

chrissy2391

Thanks to the Disscusion groups I found the following to delete blank rows:
Sub macro_der()
Dim i As Long, nLastRow As Long
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
Set r = Rows(nLastRow + 1)
For i = 1 To nLastRow
If Application.CountA(Rows(i)) = 0 Then
Set r = Union(r, Rows(i))
End If
Next
r.Delete
End Sub

It works perfect and I know want to use it in past or future workbooks.
Figured I could copy and paste in the V.B. Editor, but is there
another/easier way to use this globally? Using Excel 2003.
 
Back
Top