Hello All,
I've searched the forums for an answer to my problem and can not find it. And please bear with me, I am a complete newbie. I'm a credit analyst and am looking for a way to simplify my job.
Is there a way to copy entries from multiple textboxes in a userform to a clipboard so that they can be pasted into another application?
It seemed pretty easy at 1st. The gentleman at this website seems to have an answer but I keep getting a 424 error when assigning his code to a command button w/no changes. I just wanted to see if it worked: http://www.cpearson.com/excel/Clipboard.aspx
Dim DataObj As New MSForms.DataObject
Dim S1 As String
Dim S2 As String
S1 = "text string one"
S2 = "text string two"
With DataObj
.SetText S1, "FormatId1"
.PutInClipboard
.SetText S2, "FormatId2"
.PutInClipboard
S1 = vbNullString
S2 = vbNullString
.GetFromClipboard
S1 = .GetText("FormatId1")
S2 = .GetText("FormatId2")
End With
Debug.Print S1
Debug.Print S2
I was able to steal code from various sources to get what I needed in simple form (pasting the userform data to a worksheet and clearing the userform), but this is killing me. Help!
BTW, I uploaded what I have so far. I don't think anyone wants to see it or needs to just yet, but I didn't want to get slammed. It's not Mona Lisa, but in the end I hope it will be.
Bookmarks