computer






 

Question by  Twixx (17)

How do I run an Excel formula in VBA?

 
+7

Answer by  Nelson39 (58)

In VBA, the Application.WorksheetFunction object allows you to run Excel functions in a macro. Some of the methods with these functions (like PMT for mortgage payment) only require input into the method itself. Others, like Min, will require a separate Range object. Please consult the Help files for exact details.

 
+7

Answer by  gigo (1706)

You can do that over the application object. Try the line X = Application. Worksheetfunction. Sum([A1]+[B1]+[C1]) to receive the sum of the first three fields. Thus there is everything a variant object in VBA, this should work without variable definition.

 
+4

Answer by  jaljl25 (547)

Well first of all you have to be sure that your excel formula is correct. Your going to be entering it the same way that you would enter it in excel.

 
+1

Answer by  japratt (1687)

In order to run the this particular formula in this form you will need to switch your current format. Once you switch the current format to the new one it will work.

 
You have 50 words left!