VBaA - Scroll Bars to change date in a cell

tdigby1

New Member
Joined
Oct 9, 2014
Messages
2
Hi

Bit of a novice at VBA so any help anyone can give me would be very much appreciated.

I am trying to add a scrollbar to a spreadsheet that changes a date in a cell. I have managed to fix the bar to cell to change the date however I need to have a range of 31/01/2012 fixed as the minimum and maximum as today's date. Hopefully so that every day the spreadsheet is open the range will thus increase itself automatically to include the current date as well as allowing the user to set the date of that cell.

Any help would be much appreciated.

Kind Regards

T
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
WELCOME TO THE FORUM

I think you just need one life which might be in the worksheet_activate or worksheet_calculate event, so once that sheet is activated, the code runs and sets the Maximum value for the scrollbar

For example, if the crollbar is in sheet1, right click Sheet1, select "View code" and paste this code in there
Code:
Private Sub Worksheet_Activate()
    ScrollBar1.Max = Format(Date, "#")
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,967
Messages
6,122,503
Members
449,090
Latest member
RandomExceller01

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