Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure I understand you correct but start with this
When I'm in cell E36 and run his macro, it calculates a Net Present Value How do you calculate ? With the formula in "Sheet1" this example loop 10 times and copy to column A in "Sheet2" Sub test() For I = 1 To 10 'calculate code, not sure what you do here ? 'now copy the value of the formula to Sheet2 in A&I 'Or do you want to make a list in B30:B? also in Sheet1 Sheets("Sheet2").Range("A" & I).Value = Sheets("Sheet1").Range("E36").Value Next I End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "pattylb" wrote in message ... Here's his code in cell E36. EXP( (LN(D36)*EXP((-$B$41))) + (LN($B$39)*(1-EXP(-$B$41))) - ((1-EXP(-2*$B$41))*($B$40^2)/(4*$B$41)) + $B$40*SQRT((1-EXP(-2*$B$41))/(2*$B$41) )*E35) When I'm in cell E36 and run his macro, it calculates a Net Present Value and posts the value in B30 as well as in column A in Sheet 2. He wants it to run many times over and over so he has a list of values in Sheet 2. Sorry, I don't understand much more than that; would the worksheet help and/or can I send attachments. Thanks much again. "Ron de Bruin" wrote: Hi pattylb Can you explain what you want to do ? -- Regards Ron de Bruin http://www.rondebruin.nl "pattylb" wrote in message ... I'm trying to help someone with this looping this macro. Here's his code: ActiveCell.Range("A1:G1").Select Selection.Copy ActiveCell.Offset(-30, 0).Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ActiveCell.Offset(24, -3).Range("A1").Select Application.CutCopyMode = False Selection.Copy ActiveSheet.Next.Select ActiveCell.Offset(1, 0).Range("A1").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False End Sub I'm a rather inexperienced programmer, but my thoughts were to wrap this with a For...Next which I think I could figure out. But, I also think that the macro will have to begin in a certain cell each time in order for his offsets to work. So, any help would be appreciated that starts this macro at E36 and loops it like 5000 times. Thanks very much. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Loop | Excel Discussion (Misc queries) | |||
Help with using a Macro Loop | Excel Discussion (Misc queries) | |||
macro loop | Excel Discussion (Misc queries) | |||
how can i loop a macro | Excel Discussion (Misc queries) | |||
VBA Macro Loop | Excel Programming |