Below is the formula I have to grab an inconsistently formatted "loan number" to formatted text so I can use the second digit as criteria:
IOW Loan # in B2 is 1136578911, second digit is 1, use it as criteria in IF statement
So when I use this formula in excel, works beautifully. However, I want to hardcode it in my vba so it can autofill it. My VBA does not like the quotes and gives me the Compile error: Expected end of statement with each set of quotes. I tried double quotes in vba, ie. TEXT(B2, "0000000") has to be TEXT(B2, ""0000000""), but that formula is unrecognizable in the worksheet. How to I write this so the exact formula will be pasted in via VBA. I posted the entire VBA. I "think" I put the trouble formula in "red". If I screwed it up, it is 3/4ths of way down and only formula in the code. Thank you.
Bookmarks