Solved

Disable a Command Button

Posted on 2014-03-10
2
285 Views
Last Modified: 2014-03-10
I have a command button called StartCommandButton.  When it is clicked it runs the following procedure.  I want the button disabled when it completes the click event procedure.    Users may only click it one time.

Private Sub StartCommandButton_Click()
    ActiveCell.Offset(0, 3).Range("A1").Activate
    ActiveCell.Formula = Time
End Sub
0
Comment
Question by:cowboywm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Michael Fowler earned 500 total points
ID: 39919427
Just set the enable property to false eg

Private Sub StartCommandButton_Click()
    ActiveCell.Offset(0, 3).Range("A1").Activate
    ActiveCell.Formula = Time
    StartCommandButton.Enabled = False
End Sub 

Open in new window


Michael
0
 

Author Closing Comment

by:cowboywm
ID: 39919744
This did exactly what I wanted it to do.  Thanks, Michael.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article discusses the Chain of Responsibility pattern, explaining What it is;Why it is; andHow it is At the end of this article, I hope you will be able to describe the use and benefits of Chain of Responsibility.  Backgrou…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question