LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro Loop

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Loop stan Excel Discussion (Misc queries) 1 October 22nd 09 04:38 PM
Help with using a Macro Loop Mark Costello[_2_] Excel Discussion (Misc queries) 5 October 19th 07 02:01 PM
macro loop DM Excel Discussion (Misc queries) 1 January 3rd 06 10:46 PM
how can i loop a macro Remote help Excel Discussion (Misc queries) 1 July 21st 05 02:57 AM
VBA Macro Loop Neutron1871 Excel Programming 1 November 4th 04 09:22 AM


All times are GMT +1. The time now is 10:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"