Hi Pascal

Try:
Private Sub CommandButton1_Click()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Columns("A:A").Hidden = Not ws.Columns("A:A").Hidden
Next
End Sub

Thanks
Mahesh

On Sat, Jul 16, 2011 at 11:11 PM, bpascal123 <bpascal...@googlemail.com>wrote:

> Hi,
>
> I would like to know if there is a way to use the same code for an
> activeX toggle button present one time on all sheets in a workbook.
>
> For instance, when the toggle button is toggled, it should hide some
> columns and when "untoggled" it should show the hidden columns. Column
> numbers are the same for all sheets so the code for the button present
> on every sheet is the same.
>
> Do I need to write the code for every sheet where this object is
> located or can I make it global for the workbook ?
>
> Thanks for any help or advice.
>
> Pascal
>
> --
>
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links :
> http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><><><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to