Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2022, 04:21 AM
bil_san1 bil_san1 is offline Changing date through Form Control (Scroll Bar) Windows 10 Changing date through Form Control (Scroll Bar) Office 2016
Novice
Changing date through Form Control (Scroll Bar)
 
Join Date: Oct 2022
Posts: 12
bil_san1 is on a distinguished road
Default Changing date through Form Control (Scroll Bar)

Hi,



I am trying to change the current month date through Form Control (Scroll Bar).

But after setting up when I click on the scroll bar the data changes to 1990. How can I fix it to this month, next month and so on.....

File is attached for reference.

Thanks
Attached Files
File Type: xlsx Change Date.xlsx (10.5 KB, 4 views)
Reply With Quote
  #2  
Old 10-28-2022, 11:20 AM
kilroyscarnival kilroyscarnival is offline Changing date through Form Control (Scroll Bar) Windows 10 Changing date through Form Control (Scroll Bar) Office 2021
Expert
 
Join Date: May 2019
Posts: 345
kilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nicekilroyscarnival is just really nice
Default

The reason you're getting year 1900 is that Excel may show a date as 1/30/1900 or 3/15/2022, but it is an Excel date value of a number. Try typing 0, 20000, and 45677 in cells, then applying the date number format, and they will become 1/0/1900, 10/3/1954 and 1/20/2025 respectively. Your scroll data is set up to scroll between 1 and 31. Excel is translating that as a date to 1/1/1900 through 1/31/1900.

The hitch is that in a normal scroll bar there is a limit of 1 to 30,000, so to get to the dates for this month (44835 to 44865) you can't use the default range limits, but you'll have to use values in cells to give you the range you want.

I found this little YouTube video helpful in visualizing the process: https://www.youtube.com/watch?v=EFr0rRxrTBc&t=107s

If you always want your sheet to stay in the current month, somewhere off to the side outside the print/display area, you might want to set up the following:

First cell - let's say it's cell O3, return today's date =TODAY()
Second cell, return the first day of the current month =EOMONTH(O3,-1)+1
Third cell, return the last day of the current month =EOMONTH(O3,0)

Then point your scroll bar to the min in cell P3, and the max in Q3.

You could, of course, do all that in one formula, but this way it will give you a display of all three values for you to review.
Attached Images
File Type: jpg dates.jpg (19.0 KB, 10 views)
Reply With Quote
  #3  
Old 10-28-2022, 02:38 PM
bil_san1 bil_san1 is offline Changing date through Form Control (Scroll Bar) Windows 10 Changing date through Form Control (Scroll Bar) Office 2016
Novice
Changing date through Form Control (Scroll Bar)
 
Join Date: Oct 2022
Posts: 12
bil_san1 is on a distinguished road
Default

Thanks for the solution..

But I can't point the max and min to a cell. I can only give the value as I am using Form Control not Active X control. If you can set up in excel and shared that it would be really helpful.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing date through Form Control (Scroll Bar) Not changing a content control if re-entered and Userform pops up. ashbee Word VBA 3 01-26-2020 11:58 AM
Changing date through Form Control (Scroll Bar) Changing color of instructional text in a content control box Document Specialist Word 2 08-17-2018 05:25 AM
Changing date through Form Control (Scroll Bar) Date picker content control to always show current date. lucky16 Word VBA 2 07-01-2016 01:14 PM
Date Picker Control Karen615 Word 3 04-02-2014 02:57 PM
Page does not actively scroll with click, hold and drag on scroll-bar jbax Word 1 05-09-2013 07:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft