-
Solved: Sending Long to Clipboard or any other way to get it to Word from Excel?
Hi all,
I have a Long which is just a big number I get through summing up values of a few ranges... so it is in memory. I would like to paste the value of this Long in a Word document which I already have opened and populated, so I have something like that:
Excel:
[vba]
Dim pTotal As Long
pTotal = wsOne.Range("W33").Value + wsOne.Range("W35").Value[/vba]
Word:
[vba]wrdApp.Selection.TypeText Text:="number"
wrdApp.Selection.TypeParagraph[/vba]
All of these do work, I am just not sure how to send Long to clipboard, DataObject seems to work with String... I can than paste something like [vba]wrdApp.Selection.Paste[/vba]...
Of course a quick hack would be to set some odd cell value to my pTotal and than do a Copy and Paste but surely there is a cleaner way?
Thanks a lot
Mike
-
-
Yea you are right
I thought [VBA]wrdApp.Selection.TypeText Text:=CStr(pTotal)[/VBA] was not possible, my mistake! Thanks for setting me straight!
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules