Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm having problems to resize a range.
my data looks like this x a d x a d x a d y b when I select the data the last row is included. is there any way to resize the selection and exclude the last row (y) thank you |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you select the data how... in code? If so, show us your code.
-- Rick (MVP - Excel) "Norma" wrote in message ... I'm having problems to resize a range. my data looks like this x a d x a d x a d y b when I select the data the last row is included. is there any way to resize the selection and exclude the last row (y) thank you |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like the following:
Dim Curr As Range Dim R As Range Set Curr = ActiveCell.CurrentRegion With Curr If .Rows.Count 1 Then Set R = .Resize(.Rows.Count - 1, .Columns.Count) End If End With R.Select The CurrentRegion Curr is the rectangular region containing the ActiveCell that is bounded on the sides by either all blank cells or the end of the worksheet. The range R will refer to the CurrentRegion excluding the last row. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Thu, 16 Oct 2008 11:18:02 -0700, Norma wrote: I'm having problems to resize a range. my data looks like this x a d x a d x a d y b when I select the data the last row is included. is there any way to resize the selection and exclude the last row (y) thank you |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you so much, it works!!!!!!
"Chip Pearson" wrote: Try something like the following: Dim Curr As Range Dim R As Range Set Curr = ActiveCell.CurrentRegion With Curr If .Rows.Count 1 Then Set R = .Resize(.Rows.Count - 1, .Columns.Count) End If End With R.Select The CurrentRegion Curr is the rectangular region containing the ActiveCell that is bounded on the sides by either all blank cells or the end of the worksheet. The range R will refer to the CurrentRegion excluding the last row. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Thu, 16 Oct 2008 11:18:02 -0700, Norma wrote: I'm having problems to resize a range. my data looks like this x a d x a d x a d y b when I select the data the last row is included. is there any way to resize the selection and exclude the last row (y) thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Please help with Range.Resize | Excel Programming | |||
Resize a range | Excel Programming | |||
Range.Delete and Range.Resize.Name performance issues | Excel Programming | |||
Range resize | Excel Programming | |||
Range Resize | Excel Programming |