Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy to clipboard 1

Status
Not open for further replies.

wmbb

Technical User
Jul 17, 2005
320
NL
Is it possible to put a number in the clipboard using "copy" to paste it in another application ?
I want to detect the color-code (selection.interior.color) of a cell and paste this in another application using "ctrl V"
Code:
Sub color_code()

temp = Selection.Interior.Color
temp.Copy

End Sub
is not working
 
Add a reference to the Miscrosoft Forms 2.0 Object Library, and then:
Code:
Sub color_code()
Set MyData = New DataObject
MyData.SetText Selection.Interior.Color & ""
MyData.PutInClipboard

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for your quick response.
I've found that option too but I can't find this reference library in my list under tools - references.
How can I add this library ?

I'm using Office 2007
 
The simplest way is to insert an UserForm in your project.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you, this was exactly what I was looking for.
A star for you !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top