Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Macro to re-calcluate and count times run

I'm looking for a basic macro that re-calculates the formula in a
spreadsheet until a certain condition is met (i.e. a solution found, being a
"yes" value in a particular cell) but counts the number of times it takes
before that condition is met, and then stops recalculating and returns the
result plus the number of times that the scenario had to be run before a
solution was found. The expected number of attempts will probably be less
than 20.

Any suggestions?

Thanks in advance

Mike


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro to re-calcluate and count times run

Mike

I'd try something like
Do while
conditions here
count = count +1

code here
loop

msgbox count

End sub
and place this at the start of the loop
-----Original Message-----
I'm looking for a basic macro that re-calculates the

formula in a
spreadsheet until a certain condition is met (i.e. a

solution found, being a
"yes" value in a particular cell) but counts the number

of times it takes
before that condition is met, and then stops

recalculating and returns the
result plus the number of times that the scenario had to

be run before a
solution was found. The expected number of attempts will

probably be less
than 20.

Any suggestions?

Thanks in advance

Mike


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Macro to re-calcluate and count times run

thanks

mike

"Peter Atherton" wrote in message
...
Mike

I'd try something like
Do while
conditions here
count = count +1

code here
loop

msgbox count

End sub
and place this at the start of the loop
-----Original Message-----
I'm looking for a basic macro that re-calculates the

formula in a
spreadsheet until a certain condition is met (i.e. a

solution found, being a
"yes" value in a particular cell) but counts the number

of times it takes
before that condition is met, and then stops

recalculating and returns the
result plus the number of times that the scenario had to

be run before a
solution was found. The expected number of attempts will

probably be less
than 20.

Any suggestions?

Thanks in advance

Mike


.



Reply
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
Count how many times a phrase comes up? Deplywrker Excel Worksheet Functions 3 November 13th 08 12:52 AM
count text appear how many times & put in respec col??eg 1st times Piglet Excel Discussion (Misc queries) 3 May 29th 08 07:53 AM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Can Excel calcluate miles between zip codes? kcobb Excel Discussion (Misc queries) 11 September 28th 07 03:17 PM


All times are GMT +1. The time now is 07:26 AM.

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

About Us

"It's about Microsoft Excel"