Results 1 to 3 of 3
  1. #1
    MBerthiaume
    Guest

    Formatted value of anExcell cell

    I need to get the formatted value of an Excell cell. The value property has the value, but not formatted. The NumberFormat property has the format, but no easy way to apply it. Any suggestion?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatted value of anExcell cell

    What do you want to do with it? You can copy the cell and paste it with formatting into another cell. I haven't tried it, but I think you can get the cell value and the cell number format and use them in a Text function.
    Legare Coleman

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatted value of anExcell cell

    Use the Text property of the range. The following is an example straight out of the VBA help which shows the difference between Value and Text:

    Sub test()
    Dim c As Range
    Set c = Worksheets("Sheet2").Range("a14")
    c.Value = 1198.3
    c.NumberFormat = "$#,##0_);($#,##0)"
    MsgBox c.Value
    MsgBox c.Text

    End Sub

    HTH

    Jon

Posting Permissions

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