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

How would I make a commandbutton in a form 'enable=False' whenever another
commandbutton 'enable=True'?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Command Buttons

Hi Ranswrt,

You have not indicated how the first
CommandButton is enabled or disabled,
but try something like:

Me.CommandButton2.Enabled = _
Not Me.CommandButton1.Enabled = True

Perhaps it would be possible to provide
more specific help if you were to explain
the enabling mechanism or the purpose
of the excercise.



---
Regards.
Norman
"ranswrt" wrote in message
...
How would I make a commandbutton in a form 'enable=False' whenever another
commandbutton 'enable=True'?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Command Buttons

I turn the buttons on and off with different procedures on the userform. i
was wondering in there was an event procedure that would make sure that only
one button was on at a time.

"Norman Jones" wrote:

Hi Ranswrt,

You have not indicated how the first
CommandButton is enabled or disabled,
but try something like:

Me.CommandButton2.Enabled = _
Not Me.CommandButton1.Enabled = True

Perhaps it would be possible to provide
more specific help if you were to explain
the enabling mechanism or the purpose
of the excercise.



---
Regards.
Norman
"ranswrt" wrote in message
...
How would I make a commandbutton in a form 'enable=False' whenever another
commandbutton 'enable=True'?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Command Buttons

I'd suggest you just use two subs


Private Sub Button1_On()
Me.CommandButton2.Enabled = False
Me.CommandButton1.Enabled = True
End Sub

Private Sub Button2_On()
Me.CommandButton1.Enabled = False
Me.CommandButton2.Enabled = True
End Sub

that you call from the "different procedures", e.g.:

Private Sub UserForm_Initialize()
'Stuff here
Button1_On
End Sub

Private Sub CommandButton1_Click()
'Do more stuff
Button2_On
End Sub

Private Sub CommandButton2_Click()
'Do even more stuff
Button1_On
End Sub


In article ,
ranswrt wrote:

I turn the buttons on and off with different procedures on the userform. i
was wondering in there was an event procedure that would make sure that only
one button was on at a time.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Command Buttons

Thanks i think that will work

"JE McGimpsey" wrote:

I'd suggest you just use two subs


Private Sub Button1_On()
Me.CommandButton2.Enabled = False
Me.CommandButton1.Enabled = True
End Sub

Private Sub Button2_On()
Me.CommandButton1.Enabled = False
Me.CommandButton2.Enabled = True
End Sub

that you call from the "different procedures", e.g.:

Private Sub UserForm_Initialize()
'Stuff here
Button1_On
End Sub

Private Sub CommandButton1_Click()
'Do more stuff
Button2_On
End Sub

Private Sub CommandButton2_Click()
'Do even more stuff
Button1_On
End Sub


In article ,
ranswrt wrote:

I turn the buttons on and off with different procedures on the userform. i
was wondering in there was an event procedure that would make sure that only
one button was on at a time.


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
Command Buttons Command Button Calculations Excel Discussion (Misc queries) 4 May 25th 10 06:51 PM
Command Buttons Hoyas07 Excel Discussion (Misc queries) 2 February 11th 08 03:42 PM
Command buttons Craig[_8_] Excel Programming 4 February 8th 04 03:56 AM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM
Command buttons not available Donna Brooks Excel Programming 0 August 25th 03 04:23 PM


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