Find function inside a macro

Ricardo Caicedo

New Member
Joined
Aug 21, 2014
Messages
43
I am having problem as I am trying to use into a macro two nested functions. </SPAN>

Let me explain; I have a string variable called fName and let’s said the name is: “BILLING_REPORT_MAY_ZONE_1_LML.CSV”
</SPAN>
So in order to use this file and be classified by zone 1 need to find if the word “_1_LML” is into the file name, so I can select it. Then, I use a Boolean variable call MktGrLML to define if it is the file; so in regular sheet I can use the FIND function and I can locate this string inside of an ISERROR function as follow(in a cell): </SPAN>
ISERROR(FIND("_1_LML",fName,"TRUE","FALSE") and gave me true or false
</SPAN>
But the macro (I create the code through macro) does not work</SPAN>

MktGrLML = Application.WorksheetFunction.ISERROR(FIND(""_1_LML"",fName,1))
</SPAN>
I got a compilation error so the sentence is not correct or I cannot use in this way. Any help to create this will be greatly appreciate​
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Maybe try this:

Code:
Application.WorksheetFunction = "ISERROR(FIND(""_1_LML"",fName,1))"
 
Upvote 0

Forum statistics

Threads
1,213,520
Messages
6,114,099
Members
448,548
Latest member
harryls

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