投稿日 | : 2007/04/16(Mon) 17:59 |
投稿者 | : GOD |
Eメール | : |
URL | : |
タイトル | : Re^6: ファイルの最終更新日の変化を取得? |
> For intRow = 1 To .Rows - 1
> For intCol = 1 to .Cols - 1
> .TextMatrix(intRow,intCol) = ""
> next intCol
> next intRow
>
列数が何列あるのかな。
もし列数が多い様なら↓にすると多少早くなりますよ。(Rows-1)*(.Cols-1)回の処理が(Rows-1)*2回の処理になります。
もし、列0が数字のカウントだけなら保存する必要もないかな。
Dim lngRow As Long
Dim strCol0() As String
Dim lngSaveRows As Long
With MSHFlexGrid1
'行数を保持
lngSaveRows = .Rows
'列0の文字列を保存
ReDim strCol0(lngSaveRows)
For lngRow = 1 To lngSaveRows - 1
strCol0(lngRow) = .TextMatrix(lngRow, 0)
Next
'見出し行以外は削除(データクリア)
.Rows = 1
'行数を復活
.Rows = lngSaveRows
.FixedRows = 1
'列0のデータを復活
For lngRow = 1 To lngSaveRows - 1
.TextMatrix(lngRow, 0) = strCol0(lngRow)
Next
End With