I've made a test file to duplicate this issue. When you are looping through a variable to delete columns based on the header I can't get the select case statement to register the final column unless I add a useless variable. Let me show you what I mean.
The only difference between test and test2 is test2 has an extra variable on my "Select Case" statement. Now if you take a normal worksheet and label A1 = "red", B1 = "blue", and C1 = "green" then the Sub test will delete "red". If you run test2 the code will not delete "red".Please Login or Register to view this content.
Maybe there is a solution for this and maybe not. I am more interested in the reasoning why test fails and test2 works. Does anyone know what is going on?
Bookmarks