close

Dear Sir

How can I make a macro which will delete all the Blank rows from a data
before pasting it in Excel

Sub Test()
Dim iLastRow As Long
Dim i As Long
Dim rng As Range

iLastRow = Cells(Rows.Count, quot;Aquot;).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)quot;Nimesh Shastriquot; lt;Nimesh gt; wrote in message
...
gt; Dear Sir
gt;
gt; How can I make a macro which will delete all the Blank rows from a data
gt; before pasting it in Excel

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()