VBA Math problem

Derick63

Board Regular
Joined
Apr 6, 2018
Messages
76
Office Version
  1. 365
Hello all, Just registered but been using the forum as a major help resource but now I need help :confused:

Setup:

First of all, I'm relatively new to VBE but done quite a bit. I've built a UserForm utilizing a Combobox (ComboBox1) to choose one of 12 worksheets (Months) to enter the values from six (6) other controls on the UserForm. Below that Combobox I have a date picker (DTPicker) formatted MMMMdd, yyyy (CustomFormat) named (Reg1).

Here's my desire:
I need to alert the user when the date picked, minus 4 days, falls in the previous month suggesting to choose the correct month.

OR

When a date is selected in Reg1, minus the four (4) days then have the month from the date picker populate the ComboBox1 value.

I don't know how to approach this on the VBA side. It would surely save the user a lot of time.
I'm using Excel 2010
Thanks for your guruness with this.

Derick
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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