+ Reply to Thread
Results 1 to 5 of 5

Column Width Decimal Places Rounding

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Column Width Decimal Places Rounding

    Hi

    Is there anyway to get excel to not round off when adjusting the column width? For example, I set the column width specifically as such:

    Please Login or Register  to view this content.
    Yet when I check the width afterwards, it is at 8.5

    It does this with all the columns where it rounds it off to a single decimal as opposed to two places

    Columns need to be formatted to an exact size since they are exported to a formatted text (space deliminated) file format which is very dependant on the column width

    Any ideas on how to keep two, and not one decimal place when setting the column width?

    Thank You
    Last edited by georgeanaprop; 07-19-2010 at 09:51 AM.

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Column Width Decimal Places Rounding

    The column width is rounded to whatever size is defined by an integer number of pixels, you should be able to set to 8.43 (64 pixels). Can you post the code you're actually using?
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

  3. #3
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Column Width Decimal Places Rounding

    Thanks

    The code itself is pretty lengthy, but this is the last bit of code

    I've attached an example workbook as well

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Column Width Decimal Places Rounding

    Some of these column widths are simply not valid, as I said, the column widths are defined by the width equivalent to the nearest integer number of pixels:
    64 pixels = 8.43
    65 pixels = 8.57

    Any width setting between 8.43 and 8.57 will truncate to 8.43.

    I have to say, I'd be very surprised to see space delimited files affected by the (cosmetic) width of the columns. Are you sure these width variations are effecting changes in your output file?

  5. #5
    Registered User
    Join Date
    06-26-2009
    Location
    South Africa
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: Column Width Decimal Places Rounding

    Oh ok, i understand what you mean by the pixel integer now and how it truncates to the nearest integer

    There is a slight difference in the output file compared to what it was, but I now think that it is not because of the column widths and most likely something else altering the format (although I have stuck to the original format in pretty much every way I can think of). Nonetheless, I will figure it out

    I'm going to mark this as solved since the answer is as you stated - it will truncate according to the nearest integer number of pixels.

    Thank You!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1