Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Goal seeking in VBA 1

Status
Not open for further replies.

Noo

Technical User
Oct 1, 2001
3
ZA
Hi

Please help me!!!

I've written a simple macro which invlolves code to do a goalseek. It works perfectly if I run it from the tools menu in excel. (Tools>macros>macros)

However, if I connect the macro (Sub) to a commandButton or call it from another macro it gives me the error ("Run time error 1004: goalseek method of rangeclass failed").

Please help
Thanks
Noo

 
Try putting this at the beginning of the Sub:

Selection.Activate

If that doesn't work can you paste your code so we can have a look at it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top