Use module globally

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top