Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Disable Userform button

From another thread I worked how to disable and "grey out" a "commandbutton",
but I am using a Userforms "Button" is it possible to grey out this type of
button?

--
Trefor

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Disable Userform button

Exactly the same

Me.CommandButton1.Enabled = False


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Trefor" wrote in message
...
From another thread I worked how to disable and "grey out" a

"commandbutton",
but I am using a Userforms "Button" is it possible to grey out this type

of
button?

--
Trefor



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Disable Userform button

Bob,

Sorry what is "Me"?

And for "Button 30" is it CommandButton30? Can you use CommandButton(1)?
--
Trefor


"Bob Phillips" wrote:

Exactly the same

Me.CommandButton1.Enabled = False


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Trefor" wrote in message
...
From another thread I worked how to disable and "grey out" a

"commandbutton",
but I am using a Userforms "Button" is it possible to grey out this type

of
button?

--
Trefor




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Disable Userform button

The keyword 'Me' refers to the object that contains it. So for a
class module, it refers to that instance of the class, for a
userform, it refers to the form, etc.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Trefor" wrote in message
...
Bob,

Sorry what is "Me"?

And for "Button 30" is it CommandButton30? Can you use
CommandButton(1)?
--
Trefor


"Bob Phillips" wrote:

Exactly the same

Me.CommandButton1.Enabled = False


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Trefor" wrote in message
...
From another thread I worked how to disable and "grey out" a

"commandbutton",
but I am using a Userforms "Button" is it possible to grey
out this type

of
button?

--
Trefor






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Disable Userform button

Chip,

Sorry I am new to VBA and whatever you just said went way over the top of my
head! ;)

As for Class modules, I have not got passed Modules yet. Can you help me out
this some code for a Module please?

--
Trefor


"Chip Pearson" wrote:

The keyword 'Me' refers to the object that contains it. So for a
class module, it refers to that instance of the class, for a
userform, it refers to the form, etc.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Trefor" wrote in message
...
Bob,

Sorry what is "Me"?

And for "Button 30" is it CommandButton30? Can you use
CommandButton(1)?
--
Trefor


"Bob Phillips" wrote:

Exactly the same

Me.CommandButton1.Enabled = False


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Trefor" wrote in message
...
From another thread I worked how to disable and "grey out" a
"commandbutton",
but I am using a Userforms "Button" is it possible to grey
out this type
of
button?

--
Trefor









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Disable Userform button

Is that button on a userform?

If yes, is the code to disable the button behind that userform?

If yes, then Me refers to that userform.

If the button is on a worksheet and is a commandbutton from the control toolbox
toolbar and the code is behind that worksheet, then Me refers to that worksheet.



Trefor wrote:

Chip,

Sorry I am new to VBA and whatever you just said went way over the top of my
head! ;)

As for Class modules, I have not got passed Modules yet. Can you help me out
this some code for a Module please?

--
Trefor

"Chip Pearson" wrote:

The keyword 'Me' refers to the object that contains it. So for a
class module, it refers to that instance of the class, for a
userform, it refers to the form, etc.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Trefor" wrote in message
...
Bob,

Sorry what is "Me"?

And for "Button 30" is it CommandButton30? Can you use
CommandButton(1)?
--
Trefor


"Bob Phillips" wrote:

Exactly the same

Me.CommandButton1.Enabled = False


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Trefor" wrote in message
...
From another thread I worked how to disable and "grey out" a
"commandbutton",
but I am using a Userforms "Button" is it possible to grey
out this type
of
button?

--
Trefor








--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Disable Userform button

Trefor,

You may not know it, but userform code modules are a specific type of class
module. If you want to disable a button on a userform, there must be
something, some situation, that will determine when that button is to be
disabled. What is that?

Also, as you call it Button 30, it makes me think that you are referring to
worksheets not a userform at all. Can you clarify?



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Trefor" wrote in message
...
Chip,

Sorry I am new to VBA and whatever you just said went way over the top of

my
head! ;)

As for Class modules, I have not got passed Modules yet. Can you help me

out
this some code for a Module please?

--
Trefor


"Chip Pearson" wrote:

The keyword 'Me' refers to the object that contains it. So for a
class module, it refers to that instance of the class, for a
userform, it refers to the form, etc.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Trefor" wrote in message
...
Bob,

Sorry what is "Me"?

And for "Button 30" is it CommandButton30? Can you use
CommandButton(1)?
--
Trefor


"Bob Phillips" wrote:

Exactly the same

Me.CommandButton1.Enabled = False


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Trefor" wrote in message
...
From another thread I worked how to disable and "grey out" a
"commandbutton",
but I am using a Userforms "Button" is it possible to grey
out this type
of
button?

--
Trefor









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
Disable Exit button on a UserForm Noemi Excel Discussion (Misc queries) 1 September 14th 06 09:37 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
disable the x button on a userform [email protected] Excel Programming 3 January 8th 05 04:29 PM
How to disable the Exit Button of UserForm in Excel? Alex Excel Programming 3 December 19th 04 11:55 PM
Disable close button of Modeless Userform RB Smissaert Excel Programming 2 September 13th 03 09:46 PM


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