Thread: resize question
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default resize question

Size doesn't have anything to do with location. You can't say I want a 1
x -11 range. So you have to offset, then resize like you have shown.

or you could do

lastrow = Worksheets("Sheet1").Cells(Rows.Count, "R").End(xlUp).Row
Cells(lastrow, "H").Resize(1, 11).Copy

which would be columns H to R for the given row.
--
Regards,
Tom Ogilvy


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
lastrow = Worksheets("Sheet1").Cells(Rows.Count, "R").End(xlUp).Row
Cells(lastrow, "R").Resize(1, 11).Copy
the copy statement will copy from column r over to column ab

i wanted column r to column g, so i tried
Cells(lastrow, "R").Resize(1, -11).Copy
didn't like the minus

so i used
Cells(lastrow, "R").Offset(0, -11).Resize(1, 12).Copy

why didn't the minus 11 work and is there a better way?

thanks
--

Gary