If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macros
Dear Sir
How can I make a macro which will delete all the Blank rows from a data before pasting it in Excel |
#2
|
|||
|
|||
Macros
Sub Test()
Dim iLastRow As Long Dim i As Long Dim rng As Range iLastRow = Cells(Rows.Count, "A").End(xlUp).Row For i = 1 To iLastRow If Application.CountA(Rows(i)) = 0 Then If rng Is Nothing Then Set rng = Rows(i) Else Set rng = Union(rng, Rows(i)) End If End If Next i If Not rng Is Nothing Then rng.Delete End If End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Nimesh Shastri" Nimesh wrote in message ... Dear Sir How can I make a macro which will delete all the Blank rows from a data before pasting it in Excel |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bug: Editing digitally signed templates with macros | EZStrobe | Visio | 0 | September 17th, 2005 06:19 PM |
Macros run inconsistently: run in old records or copies of old rec | HBrock | New Users | 1 | February 9th, 2005 11:48 AM |
Passing documents with macros and toolbar icons for the macros | SteveK | Powerpoint | 1 | February 7th, 2005 07:24 PM |
Macros in 2003 multiple but connected problems? | V-ger | General Discussion | 8 | January 18th, 2005 09:42 PM |
Using macros on custom toolbars in templates. | Conan Kelly | Worksheet Functions | 2 | August 2nd, 2004 02:28 PM |