VBA code that calls a user form when a user enters a conditional date

benhop

New Member
Joined
Nov 18, 2008
Messages
35
<TABLE class=tborder id=post1862444 cellSpacing=0 cellPadding=6 width="100%" align=center border=0><TBODY><TR vAlign=top><TD class=alt1 id=td_post_1862444 style="BORDER-RIGHT: #ffffff 1px solid">Hi all,

I'm trying to figure out how to call a user form when a user enters a date that falls in between two dates in two separate ranges within a single row. I'm thinking this might be VBA code in an If-Then type format, such as "If a cells value is greater than E4 and less than AN 4 then userform1.show." Of course, I'd like that translated through proper VBA coding. Can anyone help with this request? Thanks.

Benhop.
<!-- / message --></TD></TR><TR><TD class=alt2 style="BORDER-RIGHT: #ffffff 1px solid; BORDER-TOP: #ffffff 0px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #ffffff 1px solid">
user_online.gif
</TD></TR></TBODY></TABLE>
 

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.
Maybe a Change Event
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address <> "$A$2" Then Exit Sub
If Target > Range("$B$1") And Target < Range("$B$2") Then
   UserForm1.Show
End If
End Sub

lenze
 
Upvote 0

Forum statistics

Threads
1,203,396
Messages
6,055,153
Members
444,766
Latest member
bryandaniel5

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