Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Button on a sheet

Is there a way to set a button on a worksheet to enable = false like with a
commandbutton on a userform? Will the text lighten to show that it is
disabled?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button on a sheet

If the button on the worksheet was an ActiveX button control from the
Control Toolbox toolbar, then you could put this in the UserForm's
CommandButton's Click event...

Worksheets("Sheet1").CommandButton1.Enabled = False

Change the worksheet reference and name of the button on the worksheet to
match your actual conditions.

Rick


"ranswrt" wrote in message
...
Is there a way to set a button on a worksheet to enable = false like with
a
commandbutton on a userform? Will the text lighten to show that it is
disabled?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Button on a sheet

It was put on with the forms toolbar.

"Rick Rothstein (MVP - VB)" wrote:

If the button on the worksheet was an ActiveX button control from the
Control Toolbox toolbar, then you could put this in the UserForm's
CommandButton's Click event...

Worksheets("Sheet1").CommandButton1.Enabled = False

Change the worksheet reference and name of the button on the worksheet to
match your actual conditions.

Rick


"ranswrt" wrote in message
...
Is there a way to set a button on a worksheet to enable = false like with
a
commandbutton on a userform? Will the text lighten to show that it is
disabled?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button on a sheet

I think there is a direct way to do what you want with that type of button,
but this kludge method seems to work as a substitute. Put this code line in
the Click event for the CommandButton on your UserForm...

Worksheets("Sheet1").Shapes("Button 1").TextFrame. _
Characters.Font.ColorIndex = 15

Change the worksheet reference and button name to those for your own
condition. Okay, that will change the button's font color to gray. Now, put
this line as the **FIRST** line in the macro assigned to the button

If Sheet1Shapes("Button 1").TextFrame.Characters. _
Font.ColorIndex = 15 Then Exit Sub

Again, change the worksheet reference and button name to those for your own
condition. If the button's font color is color index 15, the assigned macro
will exit before any code is executed... if the color index is any other
value, the macro code will run normally. This duplicates what happens when a
control is disabled and should suffice for your needs.

Rick


"ranswrt" wrote in message
...
It was put on with the forms toolbar.

"Rick Rothstein (MVP - VB)" wrote:

If the button on the worksheet was an ActiveX button control from the
Control Toolbox toolbar, then you could put this in the UserForm's
CommandButton's Click event...

Worksheets("Sheet1").CommandButton1.Enabled = False

Change the worksheet reference and name of the button on the worksheet to
match your actual conditions.

Rick


"ranswrt" wrote in message
...
Is there a way to set a button on a worksheet to enable = false like
with
a
commandbutton on a userform? Will the text lighten to show that it is
disabled?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Button on a sheet

I think there is a direct way to do what you want with that type of button,

That was supposed to say "I **DO NOT** think there is a direct way...

Rick



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Button on a sheet

Thanks I think I will switch the buttons to a control button from the toolbox
toolbar.
That seems alot easier.

"Rick Rothstein (MVP - VB)" wrote:

I think there is a direct way to do what you want with that type of button,


That was supposed to say "I **DO NOT** think there is a direct way...

Rick


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
Button do not appear on Sheet ! Amit Excel Programming 0 December 19th 06 07:45 PM
Button to copy sheet, rename sheet sequencially. foxgguy2005[_3_] Excel Programming 9 June 17th 05 01:41 PM
How do I create a command button to jump from sheet to sheet in a. Darlenew Excel Worksheet Functions 3 March 22nd 05 10:36 PM
button in sheet Tom Ogilvy Excel Programming 0 July 28th 04 03:08 PM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM


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