1

How can I copy the certain cell in clipboard. This is my code:

Sub Button1_Click()

Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
Dim str1 As String

clipboard.SetText ""
clipboard.PutInClipboard
    
clipboard.SetText ActiveSheet.Range("G11")
clipboard.PutInClipboard

End Sub

But in clip board the Icon that I want is like Excel Cell Copied not text copied.

Like this picture

enter image description here

braX
  • 11,506
  • 5
  • 20
  • 33
cyrnsnpdr
  • 15
  • 4
  • Does `ActiveSheet.Range("G11").Copy` do it? – chris neilsen Dec 27 '21 at 07:41
  • https://stackoverflow.com/questions/14219455/excel-vba-code-to-copy-a-specific-string-to-clipboard/60896244#60896244 – Hektors Dec 27 '21 at 07:51
  • @chrisneilsen thank you its working. How about this one once I clicked my Button there's a "True" in clipboard and that text I dont want to put in my Clipboard. Thank you – cyrnsnpdr Dec 27 '21 at 08:02

0 Answers0