Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default CommandButton - Created using Forms, Not Control Toolbox

I just created a button on my Sheet1 and assigned a Macro to it.
When I right-click on this button - I see in my NameBox "Button 1"
without the quotes.

In my Workbook_Open code I want to HIDE this button.
1st What is the code to include in the WB_Open code to do this?

After performing another procedure using VBA, what line near the bottom
of that code would make my Button 1 visible?

Or is it best to to Only load the Button at the end of the above procedure?

TIA,

Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default CommandButton - Created using Forms, Not Control Toolbox

Hi

Sheets("Sheet1").Shapes("Button 1").Visible = False

'Your code

Sheets("Sheet1").Shapes("Button 1").Visible = True

Mike

"JMay" wrote:

I just created a button on my Sheet1 and assigned a Macro to it.
When I right-click on this button - I see in my NameBox "Button 1"
without the quotes.

In my Workbook_Open code I want to HIDE this button.
1st What is the code to include in the WB_Open code to do this?

After performing another procedure using VBA, what line near the bottom
of that code would make my Button 1 visible?

Or is it best to to Only load the Button at the end of the above procedure?

TIA,

Jim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default CommandButton - Created using Forms, Not Control Toolbox

Mike Thanks alot.

I NOW have:

Private Sub Workbook_Open()
Sheets("Sheet1").Shapes("Button 1").Visible = False
Call Main
End Sub

Sub Main()
Dim res As String
res = MsgBox("Do you need help" & vbNewLine & "from your supervisor?",
vbQuestion + vbYesNo, "The Question of the Day")
If res = vbYes Then
.....

But As I now Close and reopen the file the Command button is visible
UNTIL I complete the Message box (Which seems to grab focus before the
statement line Sheets("Sheet1").Shapes("Button 1").Visible = False
How can I modify this so the Button is not visible until AFTER the
completion of the Message Box?


"Mike H" wrote:

Hi

Sheets("Sheet1").Shapes("Button 1").Visible = False

'Your code

Sheets("Sheet1").Shapes("Button 1").Visible = True

Mike

"JMay" wrote:

I just created a button on my Sheet1 and assigned a Macro to it.
When I right-click on this button - I see in my NameBox "Button 1"
without the quotes.

In my Workbook_Open code I want to HIDE this button.
1st What is the code to include in the WB_Open code to do this?

After performing another procedure using VBA, what line near the bottom
of that code would make my Button 1 visible?

Or is it best to to Only load the Button at the end of the above procedure?

TIA,

Jim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default CommandButton - Created using Forms, Not Control Toolbox

Mike, Sorry - It's Working

\I jimped the GUN -- THANKS!!


"Mike H" wrote:

Hi

Sheets("Sheet1").Shapes("Button 1").Visible = False

'Your code

Sheets("Sheet1").Shapes("Button 1").Visible = True

Mike

"JMay" wrote:

I just created a button on my Sheet1 and assigned a Macro to it.
When I right-click on this button - I see in my NameBox "Button 1"
without the quotes.

In my Workbook_Open code I want to HIDE this button.
1st What is the code to include in the WB_Open code to do this?

After performing another procedure using VBA, what line near the bottom
of that code would make my Button 1 visible?

Or is it best to to Only load the Button at the end of the above procedure?

TIA,

Jim

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
control toolbox vs forms toolbars Sasa Stankovic Excel Programming 0 December 29th 08 11:12 PM
Control Toolbox vs Forms Jon Crawford Excel Programming 1 February 20th 08 09:46 PM
difference between forms and control toolbox Manikandan Excel Discussion (Misc queries) 1 June 18th 07 04:03 PM
CommandButton - Created using Forms toolbar JMay Excel Discussion (Misc queries) 9 January 24th 07 02:11 PM
Control Toolbox vs Forms Peter Excel Programming 3 February 5th 04 04:28 PM


All times are GMT +1. The time now is 07:41 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"