Results 1 to 6 of 6

Chr(34)? What is this?

This is a discussion on Chr(34)? What is this? within the Excel Questions forums, part of the Question Forums category; I'm familiar with chr(10) and chr(13) but i'm not familiar with Chr(34). What is Chr(34)? -- g...

  1. #1
    Board Regular
    Join Date
    Nov 2009
    Posts
    586

    Default Chr(34)? What is this?

    I'm familiar with chr(10) and chr(13) but i'm not familiar with Chr(34). What is Chr(34)?

    -- g
    Home: Windows XP sp3
    Home: Excel 2010, Professional
    Work: Excel 2007, Professional

  2. #2
    Board Regular
    Join Date
    Jul 2002
    Location
    Milton Keynes, England
    Posts
    10,945

    Default Re: Chr(34)? What is this?

    I believe that is the double-quote.
    Cheers, Glenn.

    Beauty is in the eye of the beer-holder.

  3. #3
    Board Regular Leith Ross's Avatar
    Join Date
    Mar 2008
    Location
    San Francisco, CA
    Posts
    1,080

    Default Re: Chr(34)? What is this?

    Hello greegan,

    It is the double quote character.

    Sincerely,
    Leith Ross

  4. #4
    Board Regular
    Join Date
    Nov 2009
    Posts
    586

    Default Re: Chr(34)? What is this?

    Thank you to both of you.
    Under what circumstances would it be beneficial for someone to use that in a code?

    -- g
    Home: Windows XP sp3
    Home: Excel 2010, Professional
    Work: Excel 2007, Professional

  5. #5
    Board Regular Leith Ross's Avatar
    Join Date
    Mar 2008
    Location
    San Francisco, CA
    Posts
    1,080

    Default Re: Chr(34)? What is this?

    Hello greegan,

    It is most commonly used to insert a double within a string. There are times when enclosing double quotes within double quotes is confusing. Using this representation, although more code, can make the string easier to read and understand. The lines below produce the same result, the file name includes quotes, but adding Chr(34) makes this more clear.
    Code:
           CmdLine1 = "-min -a -en " & Chr$(34) & "C:\Documents and Settings\Reports.xls" & Chr$(34)
       
             
           CmdLine2 = "-min -a -en " & """C:\Documents and Settings\Reports.xls"""

  6. #6
    Board Regular
    Join Date
    Nov 2009
    Posts
    586

    Default Re: Chr(34)? What is this?

    very cool, thank you

    -- g
    Home: Windows XP sp3
    Home: Excel 2010, Professional
    Work: Excel 2007, Professional

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com