Worksheet loses formatting?
Hello All, Captain Strangequestion reporting for duty.....
Here is my dilemma...I have a workbook that has several sheets that have different formattings for different cells (ie currency, dates, etc). They populated resultant of VB codes and were working great for about a month...absolutly no issues at all.
Now, the cells have lost their formatting and I am unable to repair this. When I recreate the sheet, the formatting works fine...then...at some point in the use of the workbook, the formatting is lost again. I KNOW it must be a code issue somewhere but I can't track it down. As this project is a work in progress, I'm sure that I messed up a code but don't know where.
Is there a code or setting that I can look at that controls this? Again, even if I try to reformat the cells on the effected sheet, it will not work. I have to recreate a brand new sheet, cut and paste the values to the new sheet and strangely, the correct format follows to the new sheet.
What did I screw up? ...
Thanks in advance...
Re: Worksheet loses formatting?
Quote:
at some point in the use of the workbook, the formatting is lost again.
This majorly happens when you do a straight Copy~~>Paste (via code or directly) instead of Copy~~>Paste special... Check your code if you are doing that....
Quote:
I KNOW it must be a code issue somewhere but I can't track it down.
Can't comment much without looking at your codes...
Edit:
BTW did you check your other thread?
http://www.vbforums.com/showthread.php?t=575382
Re: Worksheet loses formatting?
It looks like there is no issue with a cut/paste code. Is there any issue or situation that would cause a worksheet to simply not display a selected format? Even when I try to format a cell to simply to show a number as currency, it will not( not through a code, just a simple format, type in a number as a test). I get the same results with unused (empty) cells in the effected worksheets. I have tested, retested, all the sequences of my codes and cannot control when this happens. Very strange. What is really strange is that to correct the sheet this is what I have to do...
1. Create a new sheet (Sheet1)
2. Select all cells from the "bad" sheet and copy
3. Paste to the "new" sheet
When I do this, the correct formatting follows the cut/paste. In other words, the cells immediately show the correct values. Also, I noticed that any cells that reference another sheet (=Setup!J) also lose that reference. The cell in the effected sheet will show =REF!J10.
I'm trying to find out what sequence of events causes this problem but I have not been able to duplicate it. Any suggestions to narrowing my search would be greatly appreciated.
Thanks