Hi, Im using this code to send data to clipboard:
Does anyone have idea why this code doesn't copy data from 1st column of listbox lstSCL?
How to fix this?
VBA Code:
Private Sub cmdCopy_Click()
Dim i As Long
Dim ClipBoardText As String
ClipBoardText = ""
For i = 0 To lstSCL.ListCount - 1
ClipBoardText = ClipBoardText & lstSCL.List(i, 0) & vbNewLine
Next i
Dim DataObj As Object
Set DataObj = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
DataObj.SetText ClipBoardText
DataObj.PutInClipboard
MsgBox "First column copied to clipboard!", vbInformation
Set DataObj = Nothing
End Sub
Does anyone have idea why this code doesn't copy data from 1st column of listbox lstSCL?
How to fix this?