Hi guys
Got a bit of brain bashing for you, i am well aware of how to clean a string of VbCrLf and also how to split data but my brain is stuck as to the best way to do what i want to do.
basically i have a string of clipboard data that is tab delimited and pasts nicely into Excel. problem is there are occasionally some unexpected VbCrLf. at first i thought ah thats easy so i did the following
almost works but i overlooked the carriage return that is needed at the end of each line to put the data in rows. just so its clear its like thisCode:Public MyDataObj As New DataObject Public StrInput() As String Public StrFinal As String Private Sub CommandButton1_Click() MyDataObj.GetFromClipboard StrInput = Replace(MyDataObj.GetText, vbCrLf, "") MyDataObj.SetText ("") MyDataObj.PutInClipboard End Sub
Data1 vbtab Data2 vbtab Data3 vbcrlf
Data1 vbtab data2 vbtab Data3 vbcrlf
So you see my above code will remove the legitimate VbCrLf any ideas?




Reply With Quote