Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for coping cells from one worksheet to another
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 D2 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for coping cells from one worksheet to another
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for coping cells from one worksheet to another
The text is very complicated to read and too long. Can you make th text shorter and show an example? Lenn -- Lenny_82 ----------------------------------------------------------------------- Lenny_821's Profile: http://www.excelforum.com/member.php...fo&userid=1517 View this thread: http://www.excelforum.com/showthread.php?threadid=40072 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looking to copy a worksheet with all formats and formulas without coping inputed data | Excel Discussion (Misc queries) | |||
Another coping and pasting macro | Excel Programming | |||
Coping numbers only in cells to other worksheets. | Excel Programming | |||
Trouble Coping Visible Cells | Excel Discussion (Misc queries) | |||
Coping all cells with data. | Excel Programming |