Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JBW JBW is offline
external usenet poster
 
Posts: 42
Default Change range from cells to sheet?

Can I change the range from cells to sheet in following. I have problem when
data is bigger than range that macro currently selects, only sorts to 159th
line. ?

Range("A1:J159").Sort Key1:=Range("B3"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Change range from cells to sheet?

n = Cells(Rows.Count, "J").End(xlUp).Row
s = "A1:J" & n
Range(s).Sort.........

Just replace the address in the Range with the string
--
Gary''s Student - gsnu200754


"JBW" wrote:

Can I change the range from cells to sheet in following. I have problem when
data is bigger than range that macro currently selects, only sorts to 159th
line. ?

Range("A1:J159").Sort Key1:=Range("B3"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Reply
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
Range name: Change from sheet specific to global CinqueTerra Excel Discussion (Misc queries) 2 July 12th 06 11:51 PM
change range of cells to another currency Max-SR Excel Worksheet Functions 3 December 31st 05 07:18 PM
How do I change the year in a range of cells Lee D Excel Discussion (Misc queries) 6 November 29th 05 08:32 PM
Copy cells into range of cells until cell change mdeanda Excel Worksheet Functions 1 April 22nd 05 08:41 PM
How do you change the size of a range of cells in a column/row SOkoll Charts and Charting in Excel 1 December 8th 04 06:43 AM


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

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

About Us

"It's about Microsoft Excel"