Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default What does this line of code do please?

Cells(i,"B").resize(,200).copy cells(i-1,"AS")


particularly please explain the meaning and function of (,200)
and the keywords cells, resize and copy

thankyou

Gary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default What does this line of code do please?

Depending on the preceeding code, i will represent a line number. For
example - 5

If i = 5 the code is basically copying the value in cell B5 and placing
it into cells AS4

Not sure what the resize is doing, can't see what changes its actually
making!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default What does this line of code do please?

Taking it step by step:

Cells(i,"B") gives the range that is the cell at row i, Column B

(example: if i=10, it gives the cell B10)

Cells(i,"B").Resize(,200) gives the range with the same top left
corner as Cells(i,"B") but with 200 columns. The ",200" means
that the optional first parameter to the Resize method is
omitted, and is assumed to be the number of rows in the
original range. As the original range has one row, this is
equivalent to Cells(i,"B").Resize(1,200)

(example: B10:GS10)

Cells(i,"B").resize(,200).copy copies the contents of the range
we've got so far...

and pastes it into: cells(i-1,"AS") - i.e. the range starting
at row i-1, column AS
(AS9 in the example)

So the effect is to copy the contents of B10:GS10 into AS9:IJ9

(These are all standard methods in VBA for Excel, and
are explained in detail in Help.)




wrote:
Cells(i,"B").resize(,200).copy cells(i-1,"AS")


particularly please explain the meaning and function of (,200)
and the keywords cells, resize and copy

thankyou

Gary


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default What does this line of code do please?

Thankyou very much,

armed with this i'm going to have another go at the problem i've been
stumped with for the last three days, when im back in the office
tomorrow.

Thanks again, I really appreciate your time

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
Macro code to put series name next to individual line in line grap Otani Charts and Charting in Excel 3 February 23rd 10 07:24 PM
Code to delete a Line in a another code helmekki[_88_] Excel Programming 1 August 8th 05 01:14 AM
add line during code Brenda Excel Programming 2 July 20th 05 10:55 PM
Continue line of VBA code on the next line peacelittleone Excel Programming 9 June 24th 05 07:46 PM
Help with 1 code line JMay Excel Programming 6 June 7th 04 03:16 AM


All times are GMT +1. The time now is 03:16 AM.

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

About Us

"It's about Microsoft Excel"