Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
CAPITALISE GLOBALLY | Excel Discussion (Misc queries) | |||
Globally replacing * | Excel Discussion (Misc queries) | |||
CLASS MODULE & SIMPLE MODULE | Excel Discussion (Misc queries) | |||
Can I globally add to a worksheet? | Excel Worksheet Functions | |||
code in module A to not execute a Worksheet_SelectionChange sub of another module | Excel Discussion (Misc queries) |