Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel VBA Command Button and Counter Dialog Box

Posted on 2006-06-29
2
Medium Priority
?
386 Views
Last Modified: 2008-02-01
I working in Excel VBA

I have this command button and when the user clicks it,  I need  a dialog box to pop up and and show it has been click 1 time and when he clicks it again to show 2 times, etc.

Any help would be appreciated!


Private Sub CommandButton28_Click()


End Sub
0
Comment
Question by:ca1358
[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 3

Accepted Solution

by:
gafoorgk earned 2000 total points
ID: 17013902
as u insert button in excel, it'll ask u to select a macro for click event of the button. if not, u can always right click and assign macro to click event. when u write a new macro name and click New button, it'll take u to vba window and a Module with name Module1 would be created. write following lines there

Option Explicit

Private glngClickCount As Long

Sub Button1_Click()
  glngClickCount = glngClickCount + 1
  MsgBox ("u clicked it " & glngClickCount & " time(s)")
End Sub
0
 

Author Comment

by:ca1358
ID: 17017570
Thank you!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

664 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