Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default resize question

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



  #2   Report Post  
Posted to microsoft.public.excel.programming
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





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default resize question

thanks tom , used it

--


Gary


"Tom Ogilvy" wrote in message
...
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







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
New Range resize Question Ray Batig Excel Programming 5 September 7th 04 02:49 AM
Resize Range Question Ray Batig Excel Programming 3 August 31st 04 02:26 AM
Resize and a question a Excel Programming 6 December 2nd 03 03:01 PM


All times are GMT +1. The time now is 07:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"