投稿日 | : 2004/12/28(Tue) 18:37 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re^3: クリップボードのデータから要素数を数えるには |
テスト結果のままのコードなので、参考までに。
Private Sub Command2_Click()
Dim myDate As String
Dim cpCol As Integer
Dim cpRow As Integer
Dim myCol As Integer
Dim myRow As Integer
If Clipboard.GetFormat(vbCFText) Then
myDate = Clipboard.GetText
End If
cpRow = UBound(Split(myDate, vbCrLf))
If cpRow > 0 Then
cpCol = (UBound(Split(myDate, vbTab)) / cpRow) + 1
End If
If cpRow = 0 Or cpCol = 0 Then Exit Sub
myCol = 2
myRow = 2
With MSFlexGrid1
.Col = myCol
.Row = myRow
.RowSel = myRow + cpRow - 1
.ColSel = myCol + cpCol - 1
.Clip = myDate
End With
End Sub