Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    milton keynes, Buckinghamshire
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Format Percent (2003)

    The following code was auto recorded by excel. But when I re-run it, it reverts the relevant worksheet range to a format of integer with one decimal place.

    ThisWorkbook.Worksheets("Time Percent").Range("W5:BU209").Select
    Selection.NumberFormat = "0.0%"

    Can someone please reccomend some better code?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Format Percent (2003)

    The code should set a percent format. The only improvement I can think of is to avoid selecting a range:

    Worksheets("Time Percent").Range("W5:BU209").NumberFormat = "0.0%"

    If the problem persists, could you attach a small workbook that demonstrates the problem

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    milton keynes, Buckinghamshire
    Posts
    252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Format Percent (2003)

    Hans

    Coding error traced. I shuld have entered Column CL not column C when formating a different section to integers with one decimal place.

Posting Permissions

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