LOL. How did I miss that.
Hey royUK . I have downloaded your calendar form. I must say, this is very good. I think my concern now is, how do I make it work on my project? Obviously, I was thinking of putting a new command button beside the textboxes to call the calendar. How do I make the dates appear on the textbox? And, is there anything else I need to change on your original codes to make it work?
Thanks, royUK . I will try that tomorrow as I am just about to go to bed now and using mobile.
Also, date picker was my first option and been searching thru the web on how to activate it. However, I can't seem to find it on my Excel. I thought maybe it wasn't installed which makes it worst.
This application will be use by my team in the office and we downloading stuff outside is strictly prohibited. That's why I am trying to find a way to make this work.
I appreciate your input, though. I'll try if this will work tomorrow.
Back here again for another question. That sounds like a vlog on YT. LOL
I have attached a sample workbook for this question.
On this workbook I have 4 dates, 1 on a label and was set during initialize.
The 3 other dates will be entered by the user on the textboxes.
What am I expecting to accomplish:
1. Each textboxes were assign to show "MM/DD/YYYY" during initialize. I set a MouseDown behavior on each textbox so when the user clicked on that textbox, the text "MM/DD/YYYY" disappears. The issue here is, when a user clicked outside textbox1 or clicked on textbox2 without putting any value on textbox1, it does not reset the textbox1 value to "MM/DD/YYYY". How would I go about setting that up?
2. I want to set all textboxes to only accept dates or numerical values instead of texts/letters., if possible.
3. I want to calculate the date difference of 2 dates but with different format outputs. First instance, I want to calculate the different of Date 1 and Date 2 but the output will be difference of Days. Second instance, I want to calculate the difference of Date 3 and 4 but the output will be difference of Years. Ideally, this will be calculated automatically once both dates are entered. Then, the output of the 1st instance will be displayed automatically on Textbox5. The output of the 2nd instance will be displayed automatically on Textbox6.
DISCLAIMER: Posting this for a new project I am planning to work on.
I want to create a UserForm with multiple Command Buttons and a single checkbox.
What I am hoping to achieve here is when I click on that single checkbox (CheckBox1), the captions on the Command Buttons will change.
A simple example would be: CommandButton1 caption is "A" and when CheckBox1 is ticked it would change to "a".
After this, when I click on the command button I am looking at 2 scenarios:
1. that caption to be automatically copied to clipboard. I'll paste it somewhere else like Notepad, etc.
2. that caption to be automatically copied and pasted to TextBox1 of the same userform.
I love this forum! I am learning a lot here.
I think I found another way to do it. Sharing it here for future use. Works fine.
Hey royUK . On the reset button you created on this UserForm, I am having a variable not defined error.
My code here is, and I modified yours:
As you can see, I now have 2 ComboBoxes, 2 TextBoxes and 19 CheckBoxes I need to clear.
I am using the same reset code for my other userform with 15 checkboxes and is working fine.
Name of the checkboxes are default only that's why I have "CheckBox" there instead of "chk" from the one you initially shared.
What do you think is making that error here?
Here is a sample workbook. It has less codes and elements.
As the title says, I have Label2 and Textbox2 on UserForm1. I want the value of this textbox to appear on TextBox1 (same userform) with Label1 showing first.
Note, there are other values on the textbox1 other than the textbox2 value.
Below is my code to show values of other functions to TextBox1.Code
- Sub FillTextBox()
- With TextBox1
- .Value = ""
- If CheckBox1 Or CheckBox2 Or CheckBox3 Or CheckBox4 Or CheckBox5 Then .Value = Label1.Caption & vbCr
- If CheckBox1 Then .Value = .Value & "• " & CheckBox1.Caption & vbCr
- If CheckBox2 Then .Value = .Value & "• " & CheckBox2.Caption & vbCr
- If CheckBox3 Then .Value = .Value & "• " & CheckBox3.Caption & vbCr
- If CheckBox4 Then .Value = .Value & "• " & CheckBox4.Caption & vbCr
- If CheckBox5 Then .Value = .Value & "• " & CheckBox5.Caption & vbCr
- If CheckBox7 Or CheckBox8 Or CheckBox9 Or CheckBox10 Or CheckBox11 Then .Value = .Value & Label2.Caption & vbCr
- If CheckBox7 Then .Value = .Value & "• " & CheckBox7.Caption & vbCr
- If CheckBox8 Then .Value = .Value & "• " & CheckBox8.Caption & vbCr
- If CheckBox9 Then .Value = .Value & "• " & CheckBox9.Caption & vbCr
- If CheckBox10 Then .Value = .Value & "• " & CheckBox10.Caption & vbCr
- If CheckBox11 Then .Value = .Value & "• " & CheckBox11.Caption & vbCr
- If ComboBox1.ListIndex > -1 Then .Value = .Value & "Will " & ComboBox1.Value
- End With
- End Sub
- ''Below are my sample codes to call FillTextBox
- Private Sub CheckBox9_Click()
- Call FillTextBox
- End Sub
- Private Sub ComboBox1_Change()
- Call FillTextBox
- End Sub
oh, I actually, I think I got it.
That's something. Only that, I am not sure where to place the new sites? Where exactly in the code, I mean. Can you give a sample?
All thanks to you, man. I posted my new question.
As you can see on the attached sample (this is not the actual workbook), I have 3 command buttons on a UserForm opening a link thru my non-default browser which is IE. What I am looking to achieve is to assign these command buttons to different hyperlinks using the 1 checkbox. On my actual project, I only need 1 checkbox to change all the hyperlinks on all the buttons.
For instance, instead of the currently assigned links. I want it changed to the ff after clicking the checkbox:
Open Google.com - https://mail.google.com
Open Yahoo.com - https://mail.yahoo.com
Open MSN.com - https://mail.msn.com
I appreciate the help, folks!
Hey royUK . So I found the problem here. Initially, my command buttons are inside a frame that's why it is not working. When the buttons are outside the frame, they work perfectly. It's all good, though. I just re-made my form to suit the code and have it working.
I have another question in connection with this, but, I will create a new thread about it to avoid confusion.
I don't even know what's going on anymore. Maybe, I have to re-do my UserForm to reset any conflicts on the codes or something.
But, what if, IE is already my default browser and I want to use Firefox or Chrome? How do I modify the code to use the browser I prefer?
Thanks again for you patience and help royUK .
It is, yeah. That's why I am puzzled why its not doing anything.
I also created a new command button, and assign the captions to that new button. Got the call command.
Still not doing anyting.
You said worksheet.
What is in the click event of your commandbutton?
Man, i really need to learn how to call names in excel. LOL
What I mean is on the project I am working on, I copy the code and paste it on the UserForm. Changed it to the caption of the Command Button. And nothing happens. Here are my codes:Code
- Sub Main()
- Select Case Me.ActiveControl.Caption
- Case "US": LaunchIE "https://www.google.com/"
- Case "Canada": LaunchIE "https://www.ozgrid.com/forum/"
- Case Else: Exit Sub
- End Select
- End Sub
- Sub LaunchIE(WebUrl As String)
- Dim IE As Object
- Set IE = CreateObject("InternetExplorer.Application")
- IE.navigate WebUrl
- IE.Visible = True
- Set IE = Nothing
- End Sub
- Private Sub CommandButton1_Click()
- End Sub
- Private Sub CommandButton2_Click()
- End Sub