Hi,
New to VBA. My goal is to automatically paste (values only) copied from an external table into cell A1 of Sheet 1 upon opening the Workbook.
I have figured out how to set the active sheet/cell and paste directly from clipboard using MS.Forms.DataObject. The problem I have is that multiple rows/columns of data are pasted into a single cell. If I try text to columns only the first row of data is shown, multiple times.
New to VBA. My goal is to automatically paste (values only) copied from an external table into cell A1 of Sheet 1 upon opening the Workbook.
I have figured out how to set the active sheet/cell and paste directly from clipboard using MS.Forms.DataObject. The problem I have is that multiple rows/columns of data are pasted into a single cell. If I try text to columns only the first row of data is shown, multiple times.
VBA Code:
Public Sub Worksheet_ActivateAndPasteSpecial()
Sheet1.Activate
Range("A1:ZZ1000").Select
Range("A1").Activate
End Sub
Sub PasteSpecial_from_Clipboard()
Dim CObj As MSForms.DataObject
Set CObj = New MSForms.DataObject
CObj.GetFromClipboard
XText = CObj.GetText(1)
ActiveSheet.Range("A1").Value = XText
End Sub