Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load UserForm if Cell Equals "xyz" 1

Status
Not open for further replies.

RP1America

Technical User
Aug 17, 2009
221
US
Fairly new to VBA, and this seems like it should be easy. I'm just not understanding at this point. Any help is greatly appreciated!

If any cell in Range rPlanAmend equals "Plan Amendment(s) *" on change (selected from drop down in those cells) then I would like to run a UserForm. If something other than "Plan Amendment(s) *" is chosen, do nothing.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rPlanAmend As Range

Set rPlanAmend = Range("A7:A17", "A20:A26")

If Range("rPlanAmend").Value <> "Plan Amendment(s) *" Then
Exit Sub
ElseIf Range("rPlanAmend").Value = "Plan Amendment(s) *" Then
Load UserForm1
UserForm1.Show
End If

End Sub

Thanks!
Ryan
 


Hi,
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Not Intersect(Target, Union([A7:A17], [A20:A26])) Is Nothing Then
    
        If Target.Value Like "Plan Amendment(s) *" Then
            Load UserForm1
            UserForm1.Show
        End If
    
    End If

End Sub

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top