Clip Property

Returns or sets the contents of a range.

Syntax

[form!]VSFlexGrid.Clip[ = value As String ]

Remarks

The string assigned to the Clip property may contain the contents of multiple rows and columns. Tab characters (vbTab or Chr(9)) indicate column breaks, and carriage return characters (vbCr or Chr(13)) indicate row breaks.

The default row and column delimiters may be changed using the ClipSeparators property.

When a string is assigned to the Clip property, only the selected cells are affected. If there are more cells in the selected region than are described in the clip string, the remaining cells are ignored. If there are more cells described in the clip string than in the selected region, the extraneous portion of the clip string is ignored. Empty entries in the Clip string will clear existing cell contents.

The example below puts text into a selected area two rows high and two columns wide.

    ' build clip string

    Dim s$

    s = "1st" & vbTab & "a" & vbCr & "2nd" & vbTab & "b"

    ' paste it over current selection

    fg.Clip = s

You may also retrieve or set a clip string for an arbitrary selection by reading the Cell property. For example, the code below copies contents of the first row to the current row:

Private Sub Command1_Click()

   Dim s$

   s = fg.Cell(flexcpText, 1, 0, 1, fg.Cols - 1)

   fg.Cell(flexcpText, fg.Row, 0, fg.Row, fg.Cols - 1) = s

End Sub

Data Type

String

See Also

VSFlexGrid Control