Hey all,
I'm trying to find the '-' in a file name using InStr. Here's the code:
I keep getting a value of 0. Shouldn't I get a 9? I think I'm missing something.![]()
Please Login or Register to view this content.
Hey all,
I'm trying to find the '-' in a file name using InStr. Here's the code:
I keep getting a value of 0. Shouldn't I get a 9? I think I'm missing something.![]()
Please Login or Register to view this content.
Take out the quotes from "MyFileName" within the InStr method, like so:
![]()
Please Login or Register to view this content.
Otherwise it is performing the InStr method on the string "MyFileName" instead of the variable MyFileName (which evaluates to the string "Operator-Joe.xlsm")
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
That did the trick! Thanks for the help.![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks