Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Variables & strings

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Variables & strings

Thank you Rick,
Worked a charm.

Regards
Tanya

"Rick Rothstein (MVP - VB)" wrote:

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



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
Variables in Query Strings [email protected] Excel Programming 2 January 10th 08 07:37 PM
Assigning multiple text strings to variables buggy Excel Programming 0 January 5th 06 08:49 PM
substitute strings with variables banavas Excel Programming 2 June 4th 04 01:29 PM
Complex Text Strings|Variables cogent Excel Programming 4 April 8th 04 02:45 AM
Converting strings to Sum worksheet function and control variables Spammastergrand Excel Programming 5 February 21st 04 05:12 PM


All times are GMT +1. The time now is 10:38 AM.

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"