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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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