Resize Range Question

  • Thread starter Thread starter Ray Batig
  • Start date Start date
R

Ray Batig

Greetings,

I am confused. This code,

Range("Mine").Resize(50).Name = "MyTable"

takes the number of columns from Mine and takes the row from Mine and then
adds 50 rows and then uses these references for MyTable.

How would I modify this resize to build MyTable maintaining the same columns
as Mine, but starting one row above the Mine row and also adding 50 rows?

Thanks in advance for your help.

Ray
 
maybe:

with range("Mine")
.offset(-1,0).resize(.rows.count+50).name = "myTable"
end with

(or should that be +51???)
 
Ray said:
Greetings,

I am confused. This code,

Range("Mine").Resize(50).Name = "MyTable"

takes the number of columns from Mine and takes the row from Mine and then
adds 50 rows and then uses these references for MyTable.

How would I modify this resize to build MyTable maintaining the same columns
as Mine, but starting one row above the Mine row and also adding 50 rows?

Thanks in advance for your help.

Ray

Your terminology is a little confusing. Range("Mine").Resize(50).Name =
"MyTable" doesn't add 50 rows to Mine; it changes the size of Mine to 50
rows. If Mine started out with 40 rows, it adds 10; If Mine started out
with 55 rows, it subtracts 5.

The following will name as "MyTable" a 51-row range with as many columns
as Mine started out with, and beginning one row above the row on which
Mine started out. Is that what you wanted?

Range("Mine")(0,1).Resize(51,Range("Mine").Columns.Count).Name="MyTable"

Alan Beban
 
Thanks to you both. Either solution worked. I appreciate your help!

Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top