tindavid
asked on
How to process lines of data in clipboard
say data of following is as below:
00195 10,000 0.370 3,700.00
00309 100,000 0.216 21,600.00
00312 4,000 0.720 mydata
00317 2,600 6.650 17,290.00
00460 1,000 3.360 3,360.00
01086 1,000 3.860 3,860.00
01157 520 10.460 5,439.20
Action: select above data, copy into clipboard
How to use Excel Macro VBA to read the data in the clipboard and process lines of data one by one
Dim DataObj As New MSForms.DataObject
Dim s As String
DataObj.GetFromClipboard
s = DataObj.GetText
MsgBox s
'
'Pseudo code needed
'
for each line in reading s
print line
next
Warning: the data for each line is separated by LF or Carriage Return
00195 10,000 0.370 3,700.00
00309 100,000 0.216 21,600.00
00312 4,000 0.720 mydata
00317 2,600 6.650 17,290.00
00460 1,000 3.360 3,360.00
01086 1,000 3.860 3,860.00
01157 520 10.460 5,439.20
Action: select above data, copy into clipboard
How to use Excel Macro VBA to read the data in the clipboard and process lines of data one by one
Dim DataObj As New MSForms.DataObject
Dim s As String
DataObj.GetFromClipboard
s = DataObj.GetText
MsgBox s
'
'Pseudo code needed
'
for each line in reading s
print line
next
Warning: the data for each line is separated by LF or Carriage Return
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.