ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   automated macro (https://www.excelbanter.com/excel-programming/277329-automated-macro.html)

Sam

automated macro
 
hello there

in sheet 1 , in column A i have 100 stock names and in column B i
have corr. stock prices.


in sheet 2 , in row 3 from cell d3 onwards till cell DA3 i am
calculating an expression that takes the stock values from sheeet 1
and applies lots of formulas and gives me an output - in that same
row.- but that is automated.......so dont worry abt that
...............

what i wud like to do - is that - to be able to have a macro that
will increment the value of cell b1 by 0.01 ie if it was initially 5 ,
now it shud be 5.01 and as i v used these values in sheet 2 , i shal
have the values in row 3 change correspondingly.....

once this is done , i want the macro to copy the contents of row 3
from sheet 2 and paste them in sheet 3.

once this is done i also want the macro to reset the value of cell b1
back to say 5 ie i want that increment to be reset....

now as this was done for cell b1 , i want that macro to do the same
process to cells b2 , b3 , b4 etc etc till b 100

so that i wud be able to have in sheet 3 - 100 rows of data ....

can some one pls help.....

thanks in advance
sam

steve

automated macro
 
Sam,

Something like:

For i = 1 to 100
Sheets("Sheet2").Cells(i,2)=Sheets("Sheet2").Cells (i,1)+0.01
Next

Change Sheet2 to your sheet. Use i + 1 to offset the row by 1. So that
B1 will go to A2. Change the 1 in Cells(i,1) to the number of whatever
column you need (A = 1, B = 2, etc.)

Amend to fit your needs. Notice that there is no selecting and no change
to the original.
--
sb
"Sam" wrote in message
om...
hello there

in sheet 1 , in column A i have 100 stock names and in column B i
have corr. stock prices.


in sheet 2 , in row 3 from cell d3 onwards till cell DA3 i am
calculating an expression that takes the stock values from sheeet 1
and applies lots of formulas and gives me an output - in that same
row.- but that is automated.......so dont worry abt that
..............

what i wud like to do - is that - to be able to have a macro that
will increment the value of cell b1 by 0.01 ie if it was initially 5 ,
now it shud be 5.01 and as i v used these values in sheet 2 , i shal
have the values in row 3 change correspondingly.....

once this is done , i want the macro to copy the contents of row 3
from sheet 2 and paste them in sheet 3.

once this is done i also want the macro to reset the value of cell b1
back to say 5 ie i want that increment to be reset....

now as this was done for cell b1 , i want that macro to do the same
process to cells b2 , b3 , b4 etc etc till b 100

so that i wud be able to have in sheet 3 - 100 rows of data ....

can some one pls help.....

thanks in advance
sam





All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com