Range resize

R

Ray Batig

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
 
J

Jim Cone

Ray,

This ought to work...

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

Regards,
Jim Cone
San Francisco, CA
 
T

Tom Ogilvy

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).Name = "Mytable"
 
A

Alan Beban

Ray said:
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
 
R

Ray Batig

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
 
Top