Kamis, 16 Januari 2014

Re: [ExcelVBA] Sorting an Unknown Range

 

Thanks Derek ~
 
That solved all the troubles I was having. Very quick too!


On Thu, Jan 16, 2014 at 12:05 PM, Derek Turner <g4swy@yahoo.com> wrote:
 

Dear Dawn

This simplified version of your code might work for you :-

Option Explicit
Sub GetRidOfBlankRows()
Dim rRangeToSort As Range
    Set rRangeToSort = Range("a1", Cells.SpecialCells(xlLastCell))
    With ActiveSheet.Sort
        .SortFields.Clear
        .SortFields.Add Key:=Range("a1")
        .SetRange rRangeToSort
        .Header = xlYes
        .Apply
    End With
End Sub

 Regards

Derek Turner
England
+++

 





--
Dawn Bleuel
"Dedicated to Living Healthier"
Live Total Wellness

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar