Function error in a Macro with nested functions

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)),""TRUE"",""FALSE"")</SPAN>

I got a compilation error so the sentence is not correct or I cannot use in this way. Any help please</SPAN>
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Find is not a VBA function. Try this:

MktGrLML = UCase(Format(InStr(1, fname, "_1_LML", vbTextCompare) > 0))
 
Upvote 0

Forum statistics

Threads
1,224,352
Messages
6,178,067
Members
452,822
Latest member
MtC

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