SIMPLE COUNTER IN EXCEL USING VBA
TO CREATE A SIMPLE COUNTER WITH A COUNT AND A RESET BUTTON . GRAPHICS ARE NEEDED IN SHEET ITSELF.
PREPARATION FOR THE PROJECT
DESIGNING THE USER INTERFACE
- Select a cell and enlarge it.
- Fix the font to be 96 or bigger.
- Use the word art to give it a lovely look. (INSERT WORD ART )
- To make the digits look like a counter
- Go to the cell and right click.
- Go to format cells.
- Go to Custom and click 0000 and check if the sample becomes 0001 or not.
- Click ok
- Out counter is ready.
- Insert a Shape as you want your button to be. (INSERTING SHAPES IN EXCEL)
- Give it a lovely shape and color.
- Change its text to COUNT.
- Copy the same button and paste a little down the previous button.
- Change its name to RESET.
- Our buttons are ready too.
- The buttons we created looked somewhat like in picture shown below.
- So now the complete USER INTERFACE IS READY.
THE COMPLETE USER INTERFACE
The complete user interface looks like this.
THE COUNTER IS IN THE CELL D3. It can be in any cell but we have to change the code accordingly.
Dim A As Integer ‘module level declaration so that all the procedures can work on this.
A = A + 1 ‘Incrementing the variable
Range(“D3”).Value = A ‘Setting the value in D3.
A = 0 ‘Setting the value to 0;
Range(“D3”).Value = A ‘Setting the value to cell D3
RUNNING THE CODE AND OUTPUT
The counter is working as per expectations.
OTHER WAYS TO REACH THIS ARTICLE
WHAT IS EXCEL, HOW EXCEL WORKS, WRITE FORMULA IN EXCEL, EXAMPLE OF USING FORMULA IN EXCEL, ANIMATED EXAMLPE OF USING FORMULA IN EXCEL
YOU MAY LIKE
- HOW TO TROUBLESHOOT A FORMULA IN EXCEL?
- USE OF FONTS, FONT SIZE, INDENTATION, TEXT TO THE RIGHT, TEXT TO THE LEFT, TEXT IN THE MIDDLE ETC.
- how to insert table in excel?
- FOR MORE ARTICLES, CLICK EXCEL OR TYPE IN SEARCH BELOW.