Code:
Sub GetClipBoardText()
Dim DataObj As MSForms.DataObject
'Dim r As Range 'this is just a trial, it did not work
'Set r = Range("b1:b???") ' unkown number of elements
Set DataObj = New MSForms.DataObject
On Error GoTo InvalidData
'~~> Get data from the clipboard.
DataObj.GetFromClipboard
'~~> Get clipboard contents
MyString = DataObj.GetText(1)
MsgBox MyString ' see attached file
Exit Sub
InvalidData:
If Err <> 0 Then MsgBox "Data on clipboard is not text or is empty"
End Sub
The message box displays the image attached
Then ...It is Gurus time.....How I get these values to a column in excel sheet like this:
column A
2500
3521
etc
The number of elements unkown