Results 1 to 3 of 3

Thread: Worksheet loses formatting?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    89

    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
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    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 Siddharth Rout; 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


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2008
    Posts
    89

    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
  •  



Click Here to Expand Forum to Full Width