|
>
>Excel97を使っている人がこのマクロを使うかもしれないのですが、それだとこのやり方をしないほうが良いんですよね?
97を使ったことがない私にとっては、想定外のことです。
では、フラグとしてIDではなく、名前でも使ったらいかがですか?
'===========================================
Sub set_rowheight_0(ByVal rng As Range)
Dim crng As Range
For Each crng In rng.Rows
crng.Name = "rheight" & crng.Row
Next
rng.RowHeight = 0
End Sub
'===============================================
Sub set_hidden(ByVal rng As Range, ByVal myvalue As Boolean)
Dim crng As Range
Dim nm As String
rng.Rows.Hidden = myvalue
If myvalue = False Then
On Error Resume Next
For Each crng In rng.Rows
Err.Clear
nm = crng.Name.Name
If Err.Number = 0 Then
crng.RowHeight = 0
End If
Next
On Error GoTo 0
End If
End Sub
'===============================================
Sub set_id_clear(ByVal rng As Range)
Dim crng As Range
For Each crng In rng.Rows
crng.Name = ""
Next
End Sub
尚、testは同じです。
|
|