hide & unhide toggle button

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
 
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
 
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

Worked great Tank you very much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top