|
>With Me.Sheets("config")
> v = .Range(.Cells(1), .Cells(256).End(xlToLeft).Offset(, 1)).Value
>End With
>ReDim Preserve v(1 To 1, 1 To UBound(v, 2) - 1)
なんかここ小癪ですね...orz
Private Sub barReset()
Dim n As Long
Dim v, vi
With Me.Sheets("config")
n = .Cells(256).End(xlToLeft).Column
If n = 1 Then
If Not IsEmpty(.Cells(1).Value) Then
v = Array(.Cells(1).Value)
End If
Else
v = .Cells(1).Resize(, n).Value
End If
End With
With Application
.CommandBars("Worksheet Menu Bar").Enabled = True
If Not IsEmpty(v) Then
For Each vi In v
.CommandBars(CLng(vi)).Visible = True
Next
End If
.DisplayFormulaBar = True
.DisplayStatusBar = True
End With
End Sub
こっちがいいかな。
|
|