The macro I've written is acting in two different manners depending on how you run it. If you click on the command button it's attached too it will miss the correct IF statement and end up using the else at the end even though that isn't correct. On the other hand if you go into the editor and run the macro directly from there it works properly and finds the correct IF statement. Why does the exact same code do two different things?