ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   RESIZE range to exclude totals row (https://www.excelbanter.com/excel-programming/425262-resize-range-exclude-totals-row.html)

MikeF[_2_]

RESIZE range to exclude totals row
 

Simply need to copy the following range *excluding* the totals row, which is
always the bottom row.
Here's one of numerous attempts that doesn't work:

Range("ak1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Resize(Rows.Count - 1, Columns.Count).Select

Any assistance would be greatly appreciated.
Thanx.
- Mike


Bob Phillips[_3_]

RESIZE range to exclude totals row
 
This should do it

With Range("ak1")

.Resize(.End(xlDown).Row - 1, .End(xlToRight).Column).Select
End With



--
__________________________________
HTH

Bob

"MikeF" wrote in message
...

Simply need to copy the following range *excluding* the totals row, which
is
always the bottom row.
Here's one of numerous attempts that doesn't work:

Range("ak1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Resize(Rows.Count - 1, Columns.Count).Select

Any assistance would be greatly appreciated.
Thanx.
- Mike




MikeF[_2_]

RESIZE range to exclude totals row
 
Bob,

Thanx for the reply.

The row part of it works fine, but it's taking *all* the columns to the
right, not just the 5, 6, 7, or whatever is there.
Is that happening on your end as well?


"Bob Phillips" wrote:

This should do it

With Range("ak1")

.Resize(.End(xlDown).Row - 1, .End(xlToRight).Column).Select
End With



--
__________________________________
HTH

Bob

"MikeF" wrote in message
...

Simply need to copy the following range *excluding* the totals row, which
is
always the bottom row.
Here's one of numerous attempts that doesn't work:

Range("ak1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Resize(Rows.Count - 1, Columns.Count).Select

Any assistance would be greatly appreciated.
Thanx.
- Mike





Bob Phillips[_3_]

RESIZE range to exclude totals row
 
Is this better?

With Range("ak1")

.Resize(.End(xlDown).Row - 1, .End(xlToRight).Column - .Column() +
1).Select
End With

--
__________________________________
HTH

Bob

"MikeF" wrote in message
...
Bob,

Thanx for the reply.

The row part of it works fine, but it's taking *all* the columns to the
right, not just the 5, 6, 7, or whatever is there.
Is that happening on your end as well?


"Bob Phillips" wrote:

This should do it

With Range("ak1")

.Resize(.End(xlDown).Row - 1, .End(xlToRight).Column).Select
End With



--
__________________________________
HTH

Bob

"MikeF" wrote in message
...

Simply need to copy the following range *excluding* the totals row,
which
is
always the bottom row.
Here's one of numerous attempts that doesn't work:

Range("ak1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Resize(Rows.Count - 1, Columns.Count).Select

Any assistance would be greatly appreciated.
Thanx.
- Mike







MikeF[_2_]

RESIZE range to exclude totals row
 
Yes, that works.
Thank you.

"Bob Phillips" wrote:

Is this better?

With Range("ak1")

.Resize(.End(xlDown).Row - 1, .End(xlToRight).Column - .Column() +
1).Select
End With

--
__________________________________
HTH

Bob

"MikeF" wrote in message
...
Bob,

Thanx for the reply.

The row part of it works fine, but it's taking *all* the columns to the
right, not just the 5, 6, 7, or whatever is there.
Is that happening on your end as well?


"Bob Phillips" wrote:

This should do it

With Range("ak1")

.Resize(.End(xlDown).Row - 1, .End(xlToRight).Column).Select
End With



--
__________________________________
HTH

Bob

"MikeF" wrote in message
...

Simply need to copy the following range *excluding* the totals row,
which
is
always the bottom row.
Here's one of numerous attempts that doesn't work:

Range("ak1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Resize(Rows.Count - 1, Columns.Count).Select

Any assistance would be greatly appreciated.
Thanx.
- Mike









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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com