+ Reply to Thread
Results 1 to 3 of 3

Formatting Variables imported into Word...

  1. #1
    Forum Contributor
    Join Date
    04-27-2006
    Location
    Cayman Islands
    Posts
    379

    Formatting Variables imported into Word...

    I have a macro that takes a value from an excel spreadsheet and inserts it into a work document at a bookmark. The number is a currency and I'd like it to be entered in the work document in this format.....

    £xx,xxx,xxx.xx rather than £xxxxxxxx.xx which is what currently happens, the script I am using is this...

    appWD.ActiveDocument.Bookmarks("ValueNumber").Range = Format(strValueNumber, "£0.00")

    'strValueNumber is from the excel spreadsheet
    'ValueNumber is the bookmark in the word document

    How would I (if it's possible) modify this to add the commas in?

  2. #2

    Re: Formatting Variables imported into Word...

    Sure, just use the format "=A3#,##0.00"
    ChrisMattock wrote:
    > I have a macro that takes a value from an excel spreadsheet and inserts
    > it into a work document at a bookmark. The number is a currency and I'd
    > like it to be entered in the work document in this format.....
    >
    > =A3xx,xxx,xxx.xx rather than =A3xxxxxxxx.xx which is what currently
    > happens, the script I am using is this...
    >
    > appWD.ActiveDocument.Bookmarks("ValueNumber").Range =3D
    > Format(strValueNumber, "=A30.00")
    >
    > 'strValueNumber is from the excel spreadsheet
    > 'ValueNumber is the bookmark in the word document
    >
    > How would I (if it's possible) modify this to add the commas in?
    >
    >
    > --
    > ChrisMattock
    > ------------------------------------------------------------------------
    > ChrisMattock's Profile: http://www.excelforum.com/member.php?action=3Dget=

    info&userid=3D33912
    > View this thread: http://www.excelforum.com/showthread...hreadid=3D547=

    047


  3. #3
    Forum Contributor
    Join Date
    04-27-2006
    Location
    Cayman Islands
    Posts
    379
    Thanks, just in case anyone else is reading this the currency symbol, in this case pound sign replaces the A3 that somehow appears in this thread. Formatting - Yawn. Thanks again!

+ 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