View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
DaveO DaveO is offline
external usenet poster
 
Posts: 94
Default Macro for coping cells from one worksheet to another

The code you need is very simple, really.

My suggestion so you can learn yourself which is 1000 times better than have
someone do it for you is this.

Record a macro that does the opetaion in full that you want, but for 1 set
of values. ie. only 1 iteration of the 100.

Then have a look at a Do While loop in the help files.

All you then need to do is create a counter that derives for you the row
number on the 'Data' you;re on and counts up in the loop.

Hope this helps.

"ShahAFFS" wrote:

Sorry just realised a mistake in original post.
Hi,
I would greatly appreciate it if someone could help me with a code that
would enable me to do the following:
I have one worksheet, 'Calc', where I input figures in cells B2, B4 & B6.
Several formulae then work off this to give results in cells C1 & C2.
Unfortunately I have almost a hundred different figs that need results for.
What I need to be able to do is, rather than manually change the figs in
cells B2, B4 & B6 and copy the results obtained from C1 & C2, write a macro
that would pick the inputs that need to go in to cells B2, B4 & B6 from a
list in another sheet in the workbook called 'Data' from A1:C100 and place
the results obtained from C1 & C2 in this sheet in columns D & E and do this
for each row. Thus the macro would copy cells A1, B1 and C1 from €˜Data and
past them into cells B2, B4 and B6 in €˜Calc respectively. This would then
give results in cells C1 & C2 in €˜Calc which the macro would then copy and
paste in cells D1 and E1 in €˜Data. The macro would then move on to the next
row in €˜Data and repeat the process until the end of the list.
I hope this makes sense. I am a complete novice at VB!
Many thanks
HS


"ShahAFFS" wrote:

Hi,
I would greatly appreciate it if someone could help me with a code that
would enable me to do the following:
I have one worksheet, 'Calc', where I input figures in cells B2, B4 & B6.
Several formulae then work off this to give results in cells C1 & C2.
Unfortunately I have almost a hundred different figs that need results for.
What I need to be able to do is, rather than manually change the figs in
cells B2, B4 & B6 and copy the results obtained from C1 & C2, write a macro
that would pick the inputs that need to go in to cells B2, B4 & B6 from a
list in another sheet in the workbook called 'Data' from A1:C100 and place
the results obtained from C1 & C2 in this sheet in columns D & E and do this
for each row. Thus the macro would copy cells A1, B1 and C1 from €˜Data and
past them into cells B2, B4 and B6 in €˜Calc respectively. This would then
give results in cells C1 & C2 in €˜Calc which the macro would then copy and
paste in cells D1 and E1 in €˜Data. The macro would then move on to the next
row in €˜Data and repeat the process until the end of the list.
I hope this makes sense. I am a complete novice at VB!
Many thanks
HS