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.
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.
Am I missing something - the workbook appears full of emptiness.
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
Last edited by dmcgov; 07-17-2020 at 02:23 PM.
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
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.
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
do you think there is anything else to clean up with the code?Please Login or Register to view this content.
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.
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.
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?
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.
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.
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
one thought is that your calendar is not starting up on a Sunday, that might be the culprit
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.
your attachment does not open correctly, see image
Attachment 687780
nevermind, working now
Last edited by dmcgov; 07-22-2020 at 07:26 AM.
so i have a question. when i went to the .Tag solution, my click event changed alot. here is the click event for label1:
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?Please Login or Register to view this content.
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.
gonna post this in a new request (as i put this as solved)
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.
Last edited by dmcgov; 07-23-2020 at 09:55 AM.
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
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)
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.Please Login or Register to view this content.
Last edited by dmcgov; 07-23-2020 at 02:40 PM.
First code returns Tuesday
vbUseSystemDayOfWeek returns 0
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks