Macro that will show a userform when a date is entered in a row that fits within two dates in that same row

benhop

New Member
Joined
Nov 18, 2008
Messages
35
Hey,

I need to create a macro when a user enters a date in column 41, when that entered date is greater than the date in column 5 and less than the date in column 40 of the corresponding row. For example, if a user enters 3/21/09, greater than 3/10/09 located in column 5, and less than 3/30/09 located in column 40 of the same row. In turn, I'd like for this macro to show a userform when a date that meets these conditions is entered. Thanks.

Benhop
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Put this macro into the sheet module where you want this to happen, rename the Userform1 reference to the name of your userform:
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("AO:AO")) Is Nothing Then
        If Target.Value > Range("E" & Target.Row).Value And _
            Target.Value < Range("AN" & Target.Row).Value Then
            UserForm1.Show
        End If
    End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,022
Members
448,939
Latest member
Leon Leenders

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