Converting formula to VBA worksheetfunction variable

WednesdayC

Board Regular
Joined
Nov 7, 2010
Messages
201
Office Version
  1. 2016
Platform
  1. MacOS
Hi All

Can anyone help me please

I have the following formula:-

WS.Cells(20, 1).Formula = _
"=IFERROR(SUM(SUMIF('RESULT ONE'!A2:A1000,{""*EMPLOYEE*"",""*FREELANCE*""},'RESULT ONE'!e2:e1000)),"""")"

I am trying to convert this formula so it works in VBA and the result is posted to a variable instead. I have tried different permutations but I just can't get this right

So assuming V is my variable - I want something like V = worksheetfunction.sum etc

I am using Excel 2016 (for Mac)

Many thanks in advance

Wednesday
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try
VBA Code:
   Dim x As Variant
   x = Evaluate("SUM(SUMIF('RESULT ONE'!A2:A1000,{""*EMPLOYEE*"",""*FREELANCE*""},'RESULT ONE'!e2:e1000))")
 
Upvote 0
Solution
VBA Code:
Dim x As Variant
x = Evaluate("SUM(SUMIF('RESULT ONE'!A2:A1000,{""*EMPLOYEE*"",""*FREELANCE*""},'RESULT ONE'!e2:e1000))")
Hi Fluff

Brilliant! Yet again, thanks so much for your help.

Regards

Wednesday
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,630
Members
449,041
Latest member
Postman24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top