Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts
    Idiot Excel question: I want to write "(2)" into a cell, but Excel
    keeps treating it as a number and converting it to -2. I am setting
    the 'Value2' property. What do I have to do to specify TEXT?!?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Option 1: insert an apostrophe ' before the text:

    Range("A1").Value = "'(2)"

    Option 2: format the cell as Text before setting its value:

    Range("A1").NumberFormat = "@"
    Range("A1").Value = "(2)"

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    La Jolla, CA
    Posts
    1,470
    Thanks
    30
    Thanked 62 Times in 58 Posts
    As usual, THANKS, Hans.

    [quote name='kweaver' post='796307' date='04-Oct-2009 18:23']Idiot Excel question: I want to write "(2)" into a cell, but Excel
    keeps treating it as a number and converting it to -2. I am setting
    the 'Value2' property. What do I have to do to specify TEXT?!?[/quote]

Posting Permissions

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