LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 464
Default Macro for changing number of rows

Dim rRange1 as Range
Set rRange1=Range(Cells(2,3),Cells(Rows.Count,3).End(X lUp))
rRange1.Sort................

Same for your other ranges.
http://www.ozgrid.com/VBA/ExcelRanges.htm


--
Regards
Dave Hawley
www.ozgrid.com

"DyingIsis" wrote in message
...
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.Sor t.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sor t.SortFields.Add
Key:=Range _
("C2:C6"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sor t.SortFields.Add
Key:=Range _
("B2:B6"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").AutoFilter.Sor t
.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


 
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
changing the number of rows the mouse scrolls through jmputt Excel Discussion (Misc queries) 1 May 24th 10 03:03 PM
Changing number of available columns & rows Otto Moehrbach[_2_] Excel Discussion (Misc queries) 5 November 2nd 09 07:16 PM
Chart changing based on change in data source (number of rows/colu Bal Ram Bhui, Jakarta Charts and Charting in Excel 1 November 16th 08 06:02 AM
Macro or addin for changing Number to words shashidharga Excel Programming 0 October 2nd 04 04:05 AM
macro, pivot table and changing number of rows Ali[_3_] Excel Programming 1 May 14th 04 04:15 PM


All times are GMT +1. The time now is 07:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"