Userform

SantanaKRE8s

Board Regular
Joined
Jul 11, 2023
Messages
114
Office Version
  1. 365
Platform
  1. Windows
Hello, I need some help with this userform. I have TextBox 1 to enter a date. ComboBox1 to select one of the two options listed. and Textbox2 will give a new date depending on what option I select in the ComboBox
FedEx Overnight is equal to 10 days
UPS Ground is equal to 14 days
So I enter a date in TextBox1 and select FedEx Overnight, 10 days will be added to the date in TextBox 1 and give the new date in TextBox2. If I select UPS Ground 14 days will be added to the date in TextBox1 and the new date will show in TextBox2.
 

Attachments

  • Dock date 1.png
    Dock date 1.png
    10.9 KB · Views: 2
  • Dock date 2.png
    Dock date 2.png
    10 KB · Views: 1

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
I am not sure what the issue is. Do you have some code that isn't doing what its supposed to?
The way I would approach this is;
On the userform, only have the Dock Date appear, once a valid date is entered, populate the Shipping Method, once the shipping method is detected, have a MSGBOX display the desired result.
 
Upvote 0
I dont have a code, I seen something similar, its with an If Statement, something ;ike if comobobox is UPS ground it adds 14 days to the date in textbox1 and the new date shows in textbox2, I just don know how to write it.
 
Upvote 0
I dont have a code, I seen something similar, its with an If Statement, something ;ike if comobobox is UPS ground it adds 14 days to the date in textbox1 and the new date shows in textbox2, I just don know how to write it.
Hey there,
if you have a userform, there is code associated with it. Post what you have and see if the group here can help!
 
Upvote 0
something like this?
1692494578052.png


Code to Initialize form and ComboBox selection.

I set up a two-column combobox: Col 1=Ship Method; Col 2=Delivery Days
then bound the ComboBox to column 2.

VBA Code:
Private Sub ComboBox1_Click()
  With ComboBox1
    TextBox2 = DateValue(TextBox1) + Val(.Value)
  End With
End Sub

Private Sub UserForm_Initialize()
  ComboBox1.AddItem "Shipper"
  ComboBox1.AddItem "FEDEX Overnight"
  ComboBox1.AddItem "UPS Ground"
  With ComboBox1
    .List(0, 1) = "Del Days"
    .List(1, 1) = 10
    .List(2, 1) = 14
  End With
End Sub
 
Upvote 1
Solution
something like this?
View attachment 97425

Code to Initialize form and ComboBox selection.

I set up a two-column combobox: Col 1=Ship Method; Col 2=Delivery Days
then bound the ComboBox to column 2.

VBA Code:
Private Sub ComboBox1_Click()
  With ComboBox1
    TextBox2 = DateValue(TextBox1) + Val(.Value)
  End With
End Sub

Private Sub UserForm_Initialize()
  ComboBox1.AddItem "Shipper"
  ComboBox1.AddItem "FEDEX Overnight"
  ComboBox1.AddItem "UPS Ground"
  With ComboBox1
    .List(0, 1) = "Del Days"
    .List(1, 1) = 10
    .List(2, 1) = 14
  End With
End Sub
Thank you very much looks really good,. Just getting back to the office today. thats exactly what I was looking for.

Forrest Kendall
2 Tim 2:2 👌
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top