PKFillmore
New Member
- Joined
- Apr 3, 2012
- Messages
- 24
Hi, im looking to create a something with VBA that will allow users to copy (values only) to the clipboard.
I know all about Paste Values however Paste Values does not work in other programs we use here at work. (Lotus notes, Java forms, etc)
I can easily come up with the code to "copy" the values of the active cell however im having difficulty on doing it with a range larger than 1
Here is my code so far....
I was thinking about using a for each cell in selection loop.. but im not sure how to form it so that if the user tries to paste it back in excel it would resume the same cell order...
Any ideas would greatly be appreciated!
I know all about Paste Values however Paste Values does not work in other programs we use here at work. (Lotus notes, Java forms, etc)
I can easily come up with the code to "copy" the values of the active cell however im having difficulty on doing it with a range larger than 1
Here is my code so far....
Code:
Dim MyVar as String
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
MyVar = Activecell.value
clipboard.SetText MyVar
clipboard.PutInClipboard
I was thinking about using a for each cell in selection loop.. but im not sure how to form it so that if the user tries to paste it back in excel it would resume the same cell order...
Code:
For Each cell In Selection
MyVar = Cell.Value
'code that stores MyVar in a range
'and will paste in the same order it was copied as
Next
Any ideas would greatly be appreciated!