![]() |
Formatting Variables imported into Word...
I have a macro that takes a value from an excel spreadsheet and insert it into a work document at a bookmark. The number is a currency and I' like it to be entered in the work document in this format..... £xx,xxx,xxx.xx rather than £xxxxxxxx.xx which is what currentl happens, the script I am using is this... appWD.ActiveDocument.Bookmarks("ValueNumber").Rang e 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 -- ChrisMattoc ----------------------------------------------------------------------- ChrisMattock's Profile: http://www.excelforum.com/member.php...fo&userid=3391 View this thread: http://www.excelforum.com/showthread.php?threadid=54704 |
Formatting Variables imported into Word...
Sure, just use the format "£#,##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..... £xx,xxx,xxx.xx rather than £xxxxxxxx.xx which is what currently happens, the script I am using is this... appWD.ActiveDocument.Bookmarks("ValueNumber").Rang e = 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? -- ChrisMattock ------------------------------------------------------------------------ ChrisMattock's Profile: http://www.excelforum.com/member.php...o&userid=33912 View this thread: http://www.excelforum.com/showthread...hreadid=547047 |
Formatting Variables imported into Word...
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! -- ChrisMattock ------------------------------------------------------------------------ ChrisMattock's Profile: http://www.excelforum.com/member.php...o&userid=33912 View this thread: http://www.excelforum.com/showthread...hreadid=547047 |
All times are GMT +1. The time now is 08:12 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com