The following code example places the names James, Nancy, and Lisa into the selected cells whenever the user selects a group of cells. When the user double-clicks, it clears the MSHFlexGrid. To run the program, press f5.
Note If you are using the MSFlexGrid, substitute "MSHFlexGrid1" with "MSFlexGrid1."
Private Sub Form1_Load ()
MSHFlexGrid1.Rows =8
MSHFlexGrid1.Cols =5
End Sub
Private Sub MSHFlexGrid1_MouseUp (Button As Integer, _
Shift as Integer, X As Single, Y As Single)
Dim myStr As String
myStr ="James" + Chr(9) + "Nancy" + Chr(9) + "Lisa"
MSHFlexGrid1.Clip =myStr
End Sub