+ Reply to Thread
Results 1 to 3 of 3

Formatting a variable used in a message

  1. #1
    Registered User
    Join Date
    11-25-2005
    Posts
    19

    Formatting a variable used in a message

    I have a variable, CostChange, that is equal to the value of a given cell formatted as $#,##0.00. However, when I use CostChange in a message variable, such as:

    Msg = "Unit cost increased by " & CostChange

    CostChange loses all its formatting. How do I find a way to fix this?

  2. #2
    Registered User
    Join Date
    02-19-2007
    Posts
    24
    Try
    Msg = "Unit cost increased by " & Excel.WorksheetFunction.Text(CostChange, "$#,##0.00")

    If CostChange is a number, it doesn't have formatting.

  3. #3
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Another similar function:
    Please Login or Register  to view this content.

+ 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