Hi,

any idea how to copy row and column data from msflexgrid to excel, I have tried looping from the selected rows and columns of msflexgrid using "VbTab" and "vbCrLf" and clipboard.setText, "vbCrLf" seems to work in separating the data into rows but data to column seems to have some problem

i have also tried using msflegrid.clip but i'm still coming up with similar results.. data to row is ok, but data to column is not

my Code:
Dim tmpCnt As String
Clipboard.Clear
tmpCnt = "a" & vbTab & "b" & vbCrLf & _
"c" & vbTab & "d" & vbCrLf & _
"1" & vbTab & "2"
Call Clipboard.SetText(tmpCnt)

thanks

Hi,

I found out that there is nothing wrong with the code, I tried "paste" to text document and notice that the "Tab" was still present

when I checked the sheet where I want to paste the clipboard the delimiter filter was set to comma, so I assume that this is the reason why my TAB was not working... I change the "VbTab" to Chr(44) then it works

but still I need other confirmation about this or better solution

thanks

Need to set text on Clipboard?
In each loop assign the value to the the cells...
That may do your need...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.