hide & unhide toggle button

  • Thread starter Thread starter 1404ottawa
  • Start date Start date
1

1404ottawa

Private Sub CommandButton1_Click()

Dim myRow As Long
Dim myAdr As String

myRow = ActiveCell.Row
myAdr = ActiveCell.Offset(0, -1).Address(0, 0)
Range("B" & myRow & ":" & myAdr).EntireColumn.Hidden = True
The macro above will hide COL B to any selected col
What can I add to thsi macro in order to toggle between hiding and unhiding that data.
Much appreciate your help
 
Private Sub CommandButton1_Click()



Dim myRow As Long

Dim myAdr As String



myRow = ActiveCell.Row

myAdr = ActiveCell.Offset(0, -1).Address(0, 0)

Range("B" & myRow & ":" & myAdr).EntireColumn.Hidden = True

The macro above will hide COL B to any selected col

What can I add to thsi macro in order to toggle between hiding and unhiding that data.

Much appreciate your help
 
Private Sub CommandButton1_Click()



Dim myRow As Long

Dim myAdr As String



myRow = ActiveCell.Row

myAdr = ActiveCell.Offset(0, -1).Address(0, 0)

Range("B" & myRow & ":" & myAdr).EntireColumn.Hidden = True

The macro above will hide COL B to any selected col

What can I add to thsi macro in order to toggle between hiding and unhiding that data.

Much appreciate your help

Worked great Tank you very much
 
Back
Top