#1   Report Post  
Posted to microsoft.public.excel.newusers
Nimesh Shastri
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.newusers
Bob Phillips
 
Posts: n/a
Default 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




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
calling a series macros with a marco gerry405 Excel Discussion (Misc queries) 0 October 18th 05 01:23 PM
Macros, How do I know what they do if I didn't create them. Abelg Excel Discussion (Misc queries) 1 September 17th 05 05:57 PM
Remove macros from spreadsheet Jan Buckley Excel Discussion (Misc queries) 1 August 12th 05 08:38 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM


All times are GMT +1. The time now is 04:21 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"