Thread: Macro Loop
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Pattylb Pattylb is offline
external usenet poster
 
Posts: 6
Default Macro Loop

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.