Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FlexGrid to excel 1

Status
Not open for further replies.

elibb

Programmer
Oct 22, 2001
335
MX
hi, i have a vb6.0 application, and im using a flexGrid control, and i can select as many cells as i want, but how can i copy my selection so the user can paste it in excel as use it as he wishes??
can it be done with a datagrid as well??

thank You
Eli
 
Use the Clipboard object in the Flexgrid keypress event:

Private Sub fg_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 3 Then ' Ctrl-C
Clipboard.Clear
Clipboard.SetText fg.Clip, flexCFText
End If
End Sub


You'll be able to paste in Excel etc with Ctrl-V


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Hi! That's great!. But what about the cherry over the cake?. Is there any way to copy to the clipboard the selected cell range including cell attributes, vgr foreground and Background colors, font, fontsize ?

Thanks...

OMC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top