VBA code Help

Joneye

Well-known Member
Joined
May 28, 2010
Messages
785
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Im looking for to go in cell A1 of a workbook, all the code is required to do is count 1 - 100 over a time say 100 seconds.

If possible can the code count up, then count down and keep repeating. But have a stop / off button?

Whats it for, im looking to automate a graph via it.

PS many thanks in advance.
 
Hi, Joneye. You probably have done it right since you were using buttons in the first place but just to be sure,
to define the click event, you must first create the command button
then double click on the button.
Then it will show you the code of
Code:
Private Sub buttonname_Click()
    'copy paste code
End Sub

The code I have written requires two buttons. one named btnStart and the other named btnStop.

1) Anyways, what kind of problem are you having with the code?
Is it not updating the value at all?

2) Are you running any other macros with this macro? If so, are you turning application.screenupdating off? If so, you will need to turn it back on when you're updating the value of cell A1.
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Ill check it when home, but I think im good for now, many thanks for all your help, any issues ill pop over a screen shot.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top