I wish not to offend anyone but I think I should Ri formulate my question on my Capendario Perpetual
Hello everyone, I try to make you a further question increasingly on the basis of my Perpetual Calendar, and the speech and this:
If I wanted to using a List box to appear something like this:
Mon Tue; Wed Thu Fri Sat Sun
1 2 3 4 5 6 7
Etc...!
No lean from bessuna part (sheet) etc ...! But only by code as the ovrei do
After almost new link to download the entire Project : https://app.box.com/s/hdckvgwmayrh5czvyjuwsccct6rmwlyo
Hi Maurizio
It is not easy to generate a perpetual calendar in a userform (or even in a worksheet) unless you use the suggestions given my Philip Treacy in your earlier post.
What I would suggest is to create the calendar using formulas on the worksheet (you can then draw the borders that you wanted around the dates) and then copy the image of the calendar onto the userform. This will require some VBA but is easier than creating the calendar on the userform itself.
I will try to post some codes later (still testing it and I am quite busy lately) so that you can modify them to incorporate into your project. The process involves copying and saving the calendar from the worksheet as and image file and then loading it back into the userform. This is the only way I can think of that can get the lines you needed on your calendar.
Sunny
Hi Maurizio
As far as I am aware of, the only way to export a picture as an image file (jpeg/bmp etc) using VBA is to paste the required picture to a chart and then saving the chart as an image file. This method can also be used to display charts in a userform.
Attached is an example with the explanations within the codes.
Hope this helps.
Sunny
Hi Maurizio
Attached is your file with my modification. Please note that I have remove the background image as the original file size is too big to be uploaded.
After entering the name, enter the date in the text box (Inerire una Data Valida) press the Estrai Data button to display the calendar.
Cheers
Sunny
First, I can not help but thank you for your support and your advice.
I have to congratulate SunnyKow for his project and very nice and much reflects what I was allowed to do myself some years ago and always taking advantage of Excel userform.
But questions are now two:
1) how can I bring back the color in its natural state, when I press the Reset button or (Clear All) so that it gives the feeling of starting from scratch.
2) It's not at all true that in a userform you can not get a perpetual calendar.
I say this because I've done it lotanto that the piston of an Image box I used 38 label for the rest does not change much from my current job.
But this I would have liked to be able to create everything just as I designed it, and because a project that is not found anywhere.
Then I think I have always said that you were free to choose the right item that you could adapt for this purpose; for example, type: A Listbox rather than a TextBox or Label etc ...!
Now I also my self I am not your safe height: I wish you could give a Look at this picture that I offer now.
Well this is just a draft, but as real and was created using a Listbox and commissioning nell'userform.
For here you could not fit it all using my project Thanks again for everything Greetings from A.Maurizio
(P.S) I forgot to tell that to achieve this result and the code:
Private Sub UserForm_Initialize()
ListBox1.ColumnCount = 7
Dim Films(1 To 7, 1 To 7) As String
Dim i As Integer, j As Integer
Films(1, 1) = "Lun"
Films(2, 1) = ""
Films(3, 1) = "6"
Films(4, 1) = "13"
Films(5, 1) = "20"
Films(6, 1) = "27"
Films(7, 1) = ""
Films(1, 2) = "Mar"
Films(2, 2) = ""
Films(3, 2) = "7"
Films(4, 2) = "14"
Films(5, 2) = "21"
Films(6, 2) = "28"
Films(7, 2) = ""
Films(1, 3) = "Mer"
Films(2, 3) = "1"
Films(3, 3) = "8"
Films(4, 3) = "15"
Films(5, 3) = "22"
Films(6, 3) = ""
Films(7, 3) = ""
Films(1, 4) = "Gio"
Films(2, 4) = "2"
Films(3, 4) = "9"
Films(4, 4) = "16"
Films(5, 4) = "27"
Films(6, 4) = ""
Films(7, 4) = ""
Films(1, 5) = "Ven"
Films(2, 5) = "3"
Films(3, 5) = "10"
Films(4, 5) = "17"
Films(5, 5) = "24"
Films(6, 5) = ""
Films(7, 5) = ""
Films(1, 6) = "Sab"
Films(2, 6) = "4"
Films(3, 6) = "11"
Films(4, 6) = "18"
Films(5, 6) = "25"
Films(6, 6) = ""
Films(7, 6) = ""
Films(1, 7) = "Dom"
Films(2, 7) = "5"
Films(3, 7) = "12"
Films(4, 7) = "19"
Films(5, 7) = "26"
Films(6, 7) = ""
Films(7, 7) = ""
ListBox1.List = Films
End Sub
Hi Maurizio
To answer your questions:
1) how can I bring back the color in its natural state, when I press the Reset button or (Clear All) so that it gives the feeling of starting from scratch.
Add this code to the Reset/Clear button. It will remove the calendar image
Image1.Picture = LoadPicture("")
2) It's not at all true that in a userform you can not get a perpetual calendar.
I did not say it cannot be done, it requires a bit more work. Since you request that the calendar be created without using buttons and text boxes and also wanted the lines, so that is what I did for you.
Thanks for sharing the codes for the listbox.
Sunny
Hello SunnyKow among other things if I could also be of help in the future, and as long as you like to other members of this forum.
I offer you my little project Always test while explaining how to create lines or triangles using the windows Bees trà other things I know very well, because the years were often working with DOS language.
Secure does not teach you anything because you are also very Diecimilavolte better than me.
Then fae foi Hello and thanks again for everything Sincere Greetings and good evening to all from A.Maurizio
(P.S) If you can let me know what you think Thanks
Hi Maurizio
Very interesting use of Listbox to create a calendar. "Stealing" your idea, I have created a listbox calendar of my own, although it is done differently (I prefer lesser VBA codes whenever possible).
I am sure that with your knowledge and experience you will be able to share them with other members in this forum. I am looking forward to it.
Cheers
Sunny
Hello SunnyKow say that you are a big and how to make a simple compliment recently.
You are Great, and true there is still much to work on it as it lacks the rest of my original project.
I have already managed to highlight the day of the month to a date entered on the sheet.
Now I concetro on Userform and here I see it a little bit harder because I have not yet figured out why every time I start to the userform the date on the paper starts from (1) and there's no way to change her mind.
But I'm just starting out then let you know, for when you do an infinite number of graces.
(P.S) At least now I have a concrete base with starting here
Sincere greetings and heartfelt thanks again to A.Maurizio
Hello Everyone, Thinking of getting rid of me.
I have forgotten about you and my promise.
It took a while to be able to put all the pieces in sequence but in the end it did.
For here I would like to give you no more pretensions My Work Completed on the Calendar; Hopefully it is of your interest, Sincerely Greetings from A.Maurizio.
This and my Link to download it all: https://app.box.com/s/oqolkok7w2i2h8zdbf4udukfu4j3wyc0