Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Reverse the order?

I got the following code here. It finds the currrent area minus the row
at the bottom (Totals) to be filtered. In one sheet, it doesn't include
a couple of columns because of a blank cell in the bottom row. I
checked, and the top row and last column always have data in all cells.
I've been trying to figure out how to do the same thing but go across
first, then down. But I can't figure it out! Anyone know how to reverse
this?

Set rStart = Range("B4")
lRow = rStart.End(xlDown).Offset(-1, 0).Row
lCol = Cells(lRow, Columns.Count).End(xlToLeft).Column
Set rEnd = Range(rStart, Cells(lRow, lCol))

Thanks for the help!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reverse the order?

Set rStart = Range("B4")
lCol = rStart.End(xlToRight).Column
lRow = cells(rStart.row,lcol).End(xldown).Row - 1
Set rEnd = Range(rStart, Cells(lRow, lCol))

--
Regards,
Tom Ogilvy


"davegb" wrote in message
oups.com...
I got the following code here. It finds the currrent area minus the row
at the bottom (Totals) to be filtered. In one sheet, it doesn't include
a couple of columns because of a blank cell in the bottom row. I
checked, and the top row and last column always have data in all cells.
I've been trying to figure out how to do the same thing but go across
first, then down. But I can't figure it out! Anyone know how to reverse
this?

Set rStart = Range("B4")
lRow = rStart.End(xlDown).Offset(-1, 0).Row
lCol = Cells(lRow, Columns.Count).End(xlToLeft).Column
Set rEnd = Range(rStart, Cells(lRow, lCol))

Thanks for the help!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Reverse the order?

Worked great! Thanks Tom.

Tom Ogilvy wrote:
Set rStart = Range("B4")
lCol = rStart.End(xlToRight).Column
lRow = cells(rStart.row,lcol).End(xldown).Row - 1
Set rEnd = Range(rStart, Cells(lRow, lCol))

--
Regards,
Tom Ogilvy


"davegb" wrote in message
oups.com...
I got the following code here. It finds the currrent area minus the row
at the bottom (Totals) to be filtered. In one sheet, it doesn't include
a couple of columns because of a blank cell in the bottom row. I
checked, and the top row and last column always have data in all cells.
I've been trying to figure out how to do the same thing but go across
first, then down. But I can't figure it out! Anyone know how to reverse
this?

Set rStart = Range("B4")
lRow = rStart.End(xlDown).Offset(-1, 0).Row
lCol = Cells(lRow, Columns.Count).End(xlToLeft).Column
Set rEnd = Range(rStart, Cells(lRow, lCol))

Thanks for the help!


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
Reverse Row Order? trvlnmny New Users to Excel 3 May 30th 10 08:22 AM
Reverse Order PL Excel Discussion (Misc queries) 3 July 1st 09 05:01 AM
Reverse Order PL Excel Discussion (Misc queries) 1 June 17th 09 02:47 AM
Reverse Order PL Excel Discussion (Misc queries) 2 June 15th 09 09:17 AM
reverse order Lamb Chop Excel Discussion (Misc queries) 2 June 20th 06 03:37 PM


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

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"