+ Reply to Thread
Results 1 to 22 of 22

scrollbar change stopped working, don't know why

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    scrollbar change stopped working, don't know why

    i had this calendar working but edit'ed the code and now it is not functioning. don't know what i did wrong.

    Can someone take a peek and tell me where i went awry?

    basically run uf_Calendar and press either scrollbar buttons. date does not change.
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: scrollbar change stopped working, don't know why

    Am I missing something - the workbook appears full of emptiness.

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    it's a simple workbook with one form (uf_Calendar). but i figured it out that i had dim'd a variable as string instead of variant. fixed it though i don't know why my locals window was showing it as variant/string. thanks for chiming in torachan. when you get a chance, let me know what you think of my project...

    here's the fixed userform
    Attached Files Attached Files
    Last edited by dmcgov; 07-17-2020 at 02:23 PM.

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: scrollbar change stopped working, don't know why

    interesting approach - still getting my head around code flow.
    I have cut out 250 lines of your label click events.
    Maybe a UserForm controls event may shorten the code further.
    Just before I saved the file I noticed the day number was out of sync to the day name for July.
    Keep at it as it looks promising.
    torachan
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    yup, thanks for cleaning up the label click events, makes it much cleaner.

    and i realize that the code in Init_SBC needs to have a major overhaul, so sorry for not cleaning that up first.

    i also changed the red icon from a square bracket to an elliptical one (has more of an organic look to it, which i liked). but the code is at home, so i will post it later.

    getting close to being finished with it, thanks for all your help.

  6. #6
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    so i changed init_sbc to below. that should clean up that mess. went ahead and added the red ellipse (to replace red bracket) so i thing im pretty close to finishing this. let me know what you think

    Please Login or Register  to view this content.
    do you think there is anything else to clean up with the code?
    Attached Files Attached Files

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: scrollbar change stopped working, don't know why

    I had a brief play and just a few oddities, with cursor in H17 - select today and date fills H17 but if you select a day from the calendar - nothing.
    however if in column A below A2 - select a date - select cell fills with date -but if you select today the cell fills with previous choice.
    the 'day name' and 'day number' are out of sync by one day.
    need an error check on February for days in excess of 29.
    I have attached one of my rudimentary 'date-pickers' to illustrate the manner I dealt with dates and leap years etc.
    You click on blue square (on day or month or year) scroll moves which ever is selected
    Onwards an upwards.
    torachan.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    so im not sure but it seems like the label click events are not firing right... so i restored my code and now it puts the correct date in the activecell. will try and play around with the code,but it seems like all is working well at this point. will post once i am done.

  9. #9
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    noticed that if i pick the previous month (in the current calendar) then it puts the day right but the month is off. same for picking next month. how can i fix that?
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    so i used the .Tag to indicate whether it's a previous month or next month. now it's working as expected. put it through the paces and let me know.
    Attached Files Attached Files

  11. #11
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: scrollbar change stopped working, don't know why

    Today date bar shows O.K.
    but the day/date tile is out of sync 21st. July is showing on a Monday.
    I am still trying to follow the relationship of the module to the userform, it seems very busy.

  12. #12
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    so found an error, when i picked June 2020, the previous month err'd out so changed the code abit.

    now as to your error, i have not found that the 21st of July is incorrect, see image below

    ShowingBothCalendars-AllAreInSync.png

    here is the latest go around
    Attached Files Attached Files

  13. #13
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    one thought is that your calendar is not starting up on a Sunday, that might be the culprit

  14. #14
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: scrollbar change stopped working, don't know why

    Just downloaded your latest file from post #10
    On opening the file the day name is still out of sync to the number tile and does not compare with your picture.
    As can be seen in attached screen capture - will try changing regional locale settings later today to see if this affects it.Attachment 687763

    attachment added againCapture.JPG
    Last edited by torachan; 07-22-2020 at 07:14 AM.

  15. #15
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    your attachment does not open correctly, see image

    Attachment 687780

    nevermind, working now
    Last edited by dmcgov; 07-22-2020 at 07:26 AM.

  16. #16
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    so i have a question. when i went to the .Tag solution, my click event changed alot. here is the click event for label1:

    Please Login or Register  to view this content.
    and here is the sub that label1 is calling:

    Please Login or Register  to view this content.
    when i run the code i get a type mismatch on this line:

    Please Login or Register  to view this content.
    do i need to set something first to make this work?

    tried this (when i ran a typename of it, i came up with "label") but it didn't work either

    Please Login or Register  to view this content.
    Last edited by dmcgov; 07-22-2020 at 07:52 AM.

  17. #17
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    gonna post this in a new request (as i put this as solved)

  18. #18
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    so here is the new workbook, moved all the code from the module into the userform, makes it more portable.

    now that i got the click events working, wondered if you still think the code is busy (and what would you have done different, not looking for code, just comments)?

    pick the Calendar wg button to load the latest userform.
    Attached Files Attached Files
    Last edited by dmcgov; 07-23-2020 at 09:55 AM.

  19. #19
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: scrollbar change stopped working, don't know why

    Good idea keeping everything within the UserForm module.
    At least if all variables are declared at the head of the code they should be available throughout.
    With both versions still the troublesome out of sync of day header to day tile number.
    All I have done is open the file > cleared the sheet > ran both forms from the on-sheet buttons.
    torachan.Capture.JPGCapture2.JPG

  20. #20
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    well, im not too sure why it would be out of sync. try running this code in the immediate window and see if it returns Wednesday (the right version) or Tuesday (the wrong calendar SOD)

    Please Login or Register  to view this content.
    as far as i know, this should always return Wednesday (unless your computer settings for 'Start Day of Week' is different than Sunday. you can check ?vbUseSystemDayOfWeek in the immediate window to see if it says 0 or 1 (or vbSunday). let me know what you find as this could throw a monkey wrench as i want to use this for all of my code going forward.
    Last edited by dmcgov; 07-23-2020 at 02:40 PM.

  21. #21
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: scrollbar change stopped working, don't know why

    First code returns Tuesday
    vbUseSystemDayOfWeek returns 0

  22. #22
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: scrollbar change stopped working, don't know why

    i am at a loss for why your SOD is different than mine, can we get someone else (in the US preferably) to try this and see if it works for them? then get someone from UK to try it as well. hopefully we figure out the issue soon.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 08-30-2017, 02:32 AM
  2. [SOLVED] excel 'has stopped working' after Worksheet Change VBA
    By milo1984 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2014, 05:05 AM
  3. Change Event Macros stopped working!?
    By kevinexcel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-17-2013, 08:00 PM
  4. Change ScrollBar Max value when a second ScrollBar vale is changed?
    By Jon Henry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2013, 06:47 PM
  5. ocde working in one windows login but stopped working in another.
    By rama1209 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2011, 08:38 AM
  6. Macro has stopped working after date change
    By markrennolds in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-01-2009, 08:31 PM
  7. [SOLVED] Reply with Change stopped working
    By Millie in forum Excel General
    Replies: 0
    Last Post: 04-23-2005, 11:08 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1