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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA Newbie question 1

Status
Not open for further replies.

HobbitK

Technical User
Jan 14, 2003
235
US
Hi everyone ... I am brand new to VBA and LOST !!!
I have a UserForm that I need to display when a specific cell is the ActiveCell. I have tried this code and it does not show the form .. what am I doing wrong?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
UserForm1.Show vbModal
End If
End Sub
I also tried changing the target line to

If ActiveCell = ("$A$2") Then

I tried with and without the () and the " "
No luck .. I know this has to be simple
any ideas .. help.
 
I think you mean to use the _selectionchange event, rather than the _change event (the latter is only fired when the cell contents change, the former when the selection changes).
Rob
[flowerface]
 
Thanks Rob .. I'll try that. Have a STAR on me !!
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top