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

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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