Results 1 to 3 of 3

Thread: Worksheet loses formatting?

  1. #1
    Lively Member
    Join Date
    Oct 08
    Posts
    88

    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...
    Last edited by NPD071; Jul 16th, 2009 at 01:33 PM.

  2. #2
    Super Moderator koolsid's Avatar
    Join Date
    Feb 05
    Location
    Mumbai, India
    Posts
    11,415

    Re: Worksheet loses formatting?

    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....

    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
    Last edited by koolsid; Jul 16th, 2009 at 04:03 PM.
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved

    Microsoft MVP: 2011 - Till Date IMP Links : Acceptable Use Policy, FAQ

    MyGear:
    Sony VGN-FZ27G with a triple boot between (XP+Office 2003+VB6), (VISTA+Office 2007+VS2008) and (Win7+Office 2010+VS2010) || Sony VPCCB-45FN with a Win7+Office 2010+VS2010. VM: (XP+Office 2003+VB6), (VISTA+Office 2007+VS2008), (Win8+Office 2010+VS2012) || Mac Book Pro (10.6.8) with Office 2011

  3. #3
    Lively Member
    Join Date
    Oct 08
    Posts
    88

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •