Add formula to Macro????

  • Thread starter Thread starter Lovebaby
  • Start date Start date
L

Lovebaby

How do I integrate a long custom formula in a macro ?

The formula will be used to manipulate a column of data.

Do I record myself actually typing the formula while I record the macro?

Is there an easier way?

Thanks
 
from vba help. I usually just use application. and omit the
..worksheetfunction part
answer = Application.Min(Worksheets("Sheet1").Range("A1:C10"))

WorksheetFunction Property
See Also Applies To Example Specifics
Returns the WorksheetFunction object. Read-only.

Example
This example displays the result of applying the Min worksheet function to
the range A1:A10.

Set myRange = Worksheets("Sheet1").Range("A1:C10")
answer = Application.WorksheetFunction.Min(myRange)
MsgBox answer
 
Formulas can only return values.

They cannot "manipulate" a column of data.

Describe what you wish to manipulate and show an example of the data.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top