Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2007

Tip: Looking for answers? Try searching our database.

Automatically run macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
michael.dellaccio@gmail.com - 02 Oct 2007 19:28 GMT
My name is Mike and i have a question about microsoft excel macro's.
Attached is a copy of the excel sheet im working on. Below the excel
sheet is the macro I built. Some of the cells contain given values and
some cells are calculated from formulas. Cell (G4) is my given
value...it is related to cell (C32). The point is, I plug a value into
cell (C10) and it runs through the rest of the calcs in the other
cells and gives me a value to cell (C32). I built a macro that works
as a goal seek pretty much. The macro makes cell (C32) equal to cell
(G4) and gives me the value for cell (C10). I want the macro to
automatically run if i take a guess at (C10) and it gives me a value
for (C32) not equal to (G4). And what would really help me out is if
the guess can stay in col C and the right value goes in col D.

Spray Noz Des Flow is cell (C10) and Tafter spray - Tsat is cell (C32)

Increment       0.01 (G3)
Value               25  (G4)
Tolerence          0.1(G5)

Spray Noz Des Flow %  27.05
Spray Noz Des Flow lbs/hr 1,352,500

Des Flow Upper Spray lbs/hr 450,833
Des Flow Lower Spray lbs/hr 901,667

UPPER SPRAY

Went fsh lbs/hr 5,000,000
Pent fsh psia 2500

Wspray design lbs/hr 450,833
h spray  btu/lb 450.0

Went upper spray lbs/hr 4,549,167
Pent upper spray psia 2600
Tent upper spray °F 900
h ent upper spray btu/lb 1381.8

h after design spray flow btu/lb 1297.8
T after design spray flow °F 693
Tsat °F 668
Tafter spray - Tsat °F 25

Macros

Sub calculateSize()
   X = 0
   TOLERANCE = Cells(5, 7).Value
   Do While X < 101
       Cells(10, 3).Value = X
       RESULT = Cells(32, 3).Value - Cells(4, 7).Value
       If RESULT < TOLERANCE And RESULT > (-1 * TOLERANCE) Then
           X = 101
       Else
           X = X + Cells(3, 7).Value
       End If
   Loop
End Sub
Barb Reinhardt - 03 Oct 2007 10:33 GMT
Have you considered using a Worksheet_Change event?

http://www.ozgrid.com/VBA/run-macros-change.htm
Signature

HTH,
Barb Reinhardt

> My name is Mike and i have a question about microsoft excel macro's.
> Attached is a copy of the excel sheet im working on. Below the excel
[quoted text clipped - 54 lines]
>     Loop
> End Sub
michael.dellaccio@gmail.com - 03 Oct 2007 13:59 GMT
No i haven't. Whats a Worksheet_Change event?
Barb Reinhardt - 04 Oct 2007 10:49 GMT
The link in my first reply explains it.
Signature

HTH,
Barb Reinhardt

> No i haven't. Whats a Worksheet_Change event?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.