ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range resize (https://www.excelbanter.com/excel-programming/309132-range-resize.html)

Ray Batig

Range resize
 
Greetings,

Mine is a range in a column. I would like to build Mytable having the same
number of rows as Mine, but, 30 columns wide.

I tried

Range("Mine").Resize( ,30).Name = "Mytable

but it gives me the error Method "Range" of object'_Global' failed.

How do I fix this? Are there some references that explain this approach?

Thanks in advance for your help!

ray



Jim Cone

Range resize
 
Ray,

This ought to work...

Dim MyTable as Range
Set MyTable = Range("Mine").Resize( ,30)

Regards,
Jim Cone
San Francisco, CA

"Ray Batig" wrote in message ink.net...
Greetings,
Mine is a range in a column. I would like to build Mytable having the same
number of rows as Mine, but, 30 columns wide.
I tried
Range("Mine").Resize( ,30).Name = "Mytable
but it gives me the error Method "Range" of object'_Global' failed.
How do I fix this? Are there some references that explain this approach?
Thanks in advance for your help!
ray



Tom Ogilvy

Range resize
 
Range("Mine").Resize( ,30).Name = "Mytable"

put a quote on the right

If you are doing this in a sheet module and "MINE" is on another sheet, then
qualify it with the worksheet. Assume MINE is on Sheet3

Worksheets("Sheet3").Range("Mine").Resize(,30).Nam e = "Mytable"

--
Regards,
Tom Ogilvy

"Ray Batig" wrote in message
ink.net...
Greetings,

Mine is a range in a column. I would like to build Mytable having the same
number of rows as Mine, but, 30 columns wide.

I tried

Range("Mine").Resize( ,30).Name = "Mytable

but it gives me the error Method "Range" of object'_Global' failed.

How do I fix this? Are there some references that explain this approach?

Thanks in advance for your help!

ray





Alan Beban[_2_]

Range resize
 
Ray Batig wrote:

Greetings,

Mine is a range in a column. I would like to build Mytable having the same
number of rows as Mine, but, 30 columns wide.

I tried

Range("Mine").Resize( ,30).Name = "Mytable

but it gives me the error Method "Range" of object'_Global' failed.

How do I fix this? Are there some references that explain this approach?

Thanks in advance for your help!

ray


You just need to close the parenthesis for "Mytable

Alan Beban

Ray Batig

<Jim, Tom, Alan Range resize
 
Thanks guys,

I had the " in the code but missed it retyping. The problem was that Mytable
was misspelled in the named range. I still would be interested in a
reference.

Ray

Alan Beban wrote in message
...
Ray Batig wrote:

Greetings,

Mine is a range in a column. I would like to build Mytable having the

same
number of rows as Mine, but, 30 columns wide.

I tried

Range("Mine").Resize( ,30).Name = "Mytable

but it gives me the error Method "Range" of object'_Global' failed.

How do I fix this? Are there some references that explain this

approach?

Thanks in advance for your help!

ray


You just need to close the parenthesis for "Mytable

Alan Beban





All times are GMT +1. The time now is 09:20 AM.

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