I want to increase Date until button is released...

hollifd

Board Regular
Joined
Apr 3, 2002
Messages
248
I have a form with a textbox on it. Under the textbox there is a button that says ">" which stands for increase Date. When I press the button, I want to increase the Date in the textbox 1 day at a time until the button is released. How do I do that in VBA?

Thanks,

David
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I think it would be a combination of MouseDown, Timer, and MouseUp events.
When you experience a mousedown, set the time interval and have the timer event increase the date by a day until the mouseup event, then stop the timer event by setting the timer interval to 0. You would control the speed of the date increase by the value of the timer interval. One second would be a value of 100 or 1000. I always have to test it.
HTH,
 
Upvote 0
Thanks VicRauch,

But while I was waiting for your answer, I noticed the "Auto Repeat" setting for my button. I never noticed that option before but it will repeat the code in the button until the button is released.

Thanks,

David
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

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