Macro for changing number of rows

D

DyingIsis

Hello -

So I'm a little less experienced than I thought.

Below is my table.
Item Rate 1 Rate 2
A 0.60% 0.30%
B 0.50% 0.40%
C 0.50% 0.70%
E 0.30% 0.30%
F 0.20% 0.50%


Below is my Macro:
Sub Ordering_Macro()
'
' Ordering_Macro Macro
'
'
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort.SortFields.Add
Key:=Range _
("C2:C6"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort.SortFields.Add
Key:=Range _
("B2:B6"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sort
..Header = xlYes
..MatchCase = False
..Orientation = xlTopToBottom
..SortMethod = xlPinYin
..Apply
End With
End Sub

I want to be able to apply this macro whether I have 30 records or 3,000
records. I always have the same 3 columns no matter how many records I have.

Any help would greatly be appreciated.

Thanks for your help in advance.

- DyingIsis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top