#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Use module globally

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.
--
Thank you,
Christine
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default Use module globally

Create an add-in or store it in your Personal Macro Workbook
http://www.ozgrid.com/VBA/excel-add-in-create.htm



--
Regards
Dave Hawley
www.ozgrid.com
"chrissy2391" wrote in message
...
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.
--
Thank you,
Christine


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CAPITALISE GLOBALLY Prasad Gopinath Excel Discussion (Misc queries) 5 February 10th 08 09:08 PM
Globally replacing * Bowler Excel Discussion (Misc queries) 2 November 6th 07 10:47 AM
CLASS MODULE & SIMPLE MODULE FARAZ QURESHI Excel Discussion (Misc queries) 1 September 7th 07 09:32 AM
Can I globally add to a worksheet? oldsquid Excel Worksheet Functions 2 February 23rd 07 11:38 PM
code in module A to not execute a Worksheet_SelectionChange sub of another module Jack Sons Excel Discussion (Misc queries) 4 December 11th 05 11:52 PM


All times are GMT +1. The time now is 04:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"