LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 48
Default How can change range to select active rows instead of :=Range("S10

I have this macro, but if you see it selects S10:S849 as range, this way do
not work for me because some times the row numbers increase and decrease,

How can I change the range only to select active rows? even when rows
numbers may vary


Range("S10").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-12]<0,""1a"","""")"
Selection.AutoFill Destination:=Range("S10:S849")

Range("S10:S849").Select
Range("A9:S849").Select
Range("S9").Activate


Selection.Sort Key1:=Range("S10"), Order1:=xlDescending, Key2:=Range( _
"Q10"), Order2:=xlAscending, Key3:=Range("G10"),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal



Thanks
LD
--
Lorenzo DÃ*az
Cad Technician
 
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
Using "=randbetween" to select a number from a range of cells a0xbjzz Excel Worksheet Functions 4 August 4th 07 07:47 PM
Select always same Rows range Nauj Solrac Excel Discussion (Misc queries) 2 April 26th 07 08:10 PM
Run-time error "1004" Select method of range class failed Tallan Excel Discussion (Misc queries) 3 March 7th 07 05:22 PM
Range("cell").Select Problem CWillis Excel Discussion (Misc queries) 2 June 5th 06 09:16 PM
range("a1").select not working tkaplan Excel Discussion (Misc queries) 3 October 27th 05 06:16 PM


All times are GMT +1. The time now is 02:16 AM.

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"