The Cells(I, 11).NumberFormat = "@" is not working after exiting a for loop

14 views Asked by At

I have a for loop that goes through a table looking for the current month. This works fine but when I get a hit, I exit the for loop and find the text field with the value of Dec23 is changed to 23 Dec and format custom by excel 2010. I then try to use the Cells(I, 11).NumberFormat = "@" to change it back to text and load Dec23 back into the cell. For some reason it is not doing anything to fix it. Is there a timming problem or what? Is the I value from the exited FOR still available, or has excel reset it?

I printed out the values and they look good but the formate is still custom and the data is still 23 Dec.

0

There are 0 answers