Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default hide & unhide toggle button

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default hide & unhide toggle button

Hello,

I'd try just one small change to the line below:


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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default hide & unhide toggle button

On Wednesday, October 31, 2012 3:26:28 PM UTC-4, wrote:
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default hide & unhide toggle button

On Wednesday, October 31, 2012 3:26:28 PM UTC-4, wrote:
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide/Unhide Toggle BEEJAY Excel Programming 3 July 17th 08 08:32 PM
Toggle Button in Ribbon to Hide/Show Built-in Tabs Don[_30_] Excel Programming 0 March 27th 08 01:17 PM
using a toggle button to show or hide information in several cells hanson Excel Worksheet Functions 3 December 7th 07 11:16 PM
HOW CAN I HAVE THE SHEET TO BE PROTECTED, FORMULAS HIDDEN AND YET GIVE AN OPTION IN VB TO HAVE A TOGGLE TO PROTECT/ UNPROTECT/HIDE/UNHIDE CELLS CAPTGNVR Excel Programming 0 February 17th 07 12:13 PM
Syntax of hide/unhide personal.xls toggle mikeburg[_32_] Excel Programming 2 September 24th 05 01:24 AM


All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"