Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default Macro to run when cell click

I'm trying to write a macro to call a userform when you click in a cell. This
is what i've got which works when someone types a character in the cell.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$5" Then
userform1.show
End If
End Sub

Any way to change this so the form is called when the cell is selected?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Macro to run when cell click

Just make it SelectionChange should work.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$C$5" Then
userform1.show
End If
End Sub


"Brad" wrote:

I'm trying to write a macro to call a userform when you click in a cell. This
is what i've got which works when someone types a character in the cell.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$5" Then
userform1.show
End If
End Sub

Any way to change this so the form is called when the cell is selected?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run a macro upon a cell click Banzai Excel Programming 3 July 26th 07 09:19 PM
Is this possible? Click a cell to run a macro John Smith Excel Programming 2 November 23rd 06 03:37 PM
Macro on cell click?? PG Oriel[_2_] Excel Programming 6 February 6th 06 10:24 PM
Macro on cell click?? Gary''s Student Excel Programming 0 February 6th 06 09:29 PM
Run Macro on Cell Click.. scottymelloty[_12_] Excel Programming 1 November 17th 04 06:15 PM


All times are GMT +1. The time now is 12:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"