ron said:
Hi Simka...Just copy and paste the following code into a module.
Assign whatever it is that you want to move to the clipboard to
"my_var". The ActiveSheet.Paste line simply demonstrates that you
have copied the information to the clipboard. Change or delete this
line depending on what you want to do with the information once it is
in the clipboard...ron
Sub CopyToClipboard()
Dim mystring As New DataObject
my_var = "assign something to the variable"
mystring.SetText my_var
mystring.PutInClipboard
ActiveSheet.PasteSpecial Format:="Text"
End Sub
Hi ron,
Ah-ha, this is better. this is what I'm nearly trying to get to. I vaguely
seem to remember years ago I had the same sort of problem but I used a
totally different approach, maybe one day I'll remember how I did it.
Anyway I've slightly adjusted your code to accommodate my needs.
Have a look at my reply to Wigi, this may help you understand more or less
what I was trying to achieve. This was so that I could select a number of
different cells (with values), add all the values and and hold the result in
a variable for later use and I also wanted to hold the result in the
clipboard instead of placing the result in a cell.
Cheers & thanks,
Simka.