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>
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>