Results 1 to 10 of 10
  1. #1
    Star Lounger skip's Avatar
    Join Date
    May 2002
    Location
    Connecticut, USA, Connecticut, USA
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Adding double quotes around numeric data field

    Hi,
    I need to add double quotes around data in a spreadsheet. I found a custom cell format that works with text ("''"@"''" that is quote,2 apostrophes, quote,@, quote, 2 apostrophes, quote) but it doesn't affect fields with numbers.
    Any ideas? Thanks in advance!!

    Skip
    Skip Whitten, MCITP
    http://www.skipwhitten.info

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,469
    Thanks
    30
    Thanked 61 Times in 57 Posts
    Your custom format worked for me in 2010 with numbers IFF I applied the customer format FIRST, then entered the number. Hmmm.

  3. #3
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    K,

    It works because when you do that you are entering text not numbers. Try to sum() them and you 'll get 0!
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    Try a custom format like:
    '"'0'"'[single quote][dbl quote][single quote][zero][single quote][dbl quote][single quote]

    Steve

  5. #5
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,469
    Thanks
    30
    Thanked 61 Times in 57 Posts
    I knew it was text when you format first, then insert the "number"...
    Unless you format first, the custom format doesn't seem to handle numbers for this example.

    Unless I did something incorrect, Steve's approach, which I also tried, returns a '0' unfortunately.

    I suspect the only way is using concatenation.

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    Steve's approach, which I also tried, returns a '0' unfortunately.
    Sorry, should have tested it. Try this:
    ''0''[single quote][single quote][zero][single quote][single quote]

    Not really a dbl quote it is 2 single quotes, but it looks like what you want and it is about the appearance.

    Steve
    PS or even, if you want a general format rather than whole numbers

    ''general''[single quote][single quote][general][single quote][single quote]
    Last edited by sdckapr; 2012-03-19 at 14:56.

  7. #7
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    I'm curious as to why the OP wants to do this?
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  8. #8
    Star Lounger skip's Avatar
    Join Date
    May 2002
    Location
    Connecticut, USA, Connecticut, USA
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts
    I'm not sure if I am the OP but we are importing journal entries into an accounting system. We can use either ASCII or a delimited file (*.DEL). All data requires double quotes and a comma in between. Thanks for all the help!

    Skip
    Skip Whitten, MCITP
    http://www.skipwhitten.info

  9. #9
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    Skip,

    Yes, you were the OP {Original Poster}. I thought that might be what you are up to. I find it unusual that the program would require quotes around mumbers. Standard practice for delimited files is to have quotes only around strings w/spaces although most export routines will put quotes around all strings and commas to delimit the fields. Have you tried just saving the worksheet as a .csv file and renaming it to .del? Of course you would need to format your numbers so they did not have commas in them.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  10. The Following User Says Thank You to RetiredGeek For This Useful Post:

    skip (2012-03-20)

  11. #10
    Star Lounger skip's Avatar
    Join Date
    May 2002
    Location
    Connecticut, USA, Connecticut, USA
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Ah, OP (Original Poster), now I get it. Yes, it is unusual and the backend is MS SQL. Optional fields (blank) also need the double quotes. Without them the import fails.

    Skip
    Skip Whitten, MCITP
    http://www.skipwhitten.info

Posting Permissions

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