View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_1402_] Rick Rothstein \(MVP - VB\)[_1402_] is offline
external usenet poster
 
Posts: 1
Default Variables & strings

Assuming that sheet is Sheet1...

Sub MakeCommandButtonsVisible()
Dim Obj As Object
For Each Obj In Worksheets("Sheet1").OLEObjects
Obj.Visible = True
Next
End Sub

If you want to do this to the active sheet instead of a specific sheet, just
substitute ActiveSheet for the Worksheets("Sheet1") reference.

Rick


"Tanya" wrote in message
...
I have multiple commandbuttons on a single sheet and I wish to make them
all
visible
Do I have to list each button as follows, or can I use a string?

CommandButton1.Visible = True

cheers
Tanya