Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Change Event on a Specific Cell

I'm using data validation on one cell, say C19. Is there a pre-defined event
that we can use so that when there is a change on this specific cell it will
prompt the user for a password?

I'm new, I already have this code: (but it's not working)

Private Sub Worksheet_Change(ByVal C19 As Range)
Set pass = Application.InputBox(prompt:="Enter a Password", Type:=2)
End Sub

I found events only on workbook and worksheet but nothing on a specific
cell. Do you think this is possible? Help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Change Event on a Specific Cell

Check VBA help for the Intersect method. Maybe you are looking for something
along the lines of:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("C19")) Is Nothing Then
pass = Application.InputBox(prompt:="Enter a Password", Type:=2)
If pass < YourPassword Then Application.Undo
End If
End Sub


"Sashi" wrote:

I'm using data validation on one cell, say C19. Is there a pre-defined event
that we can use so that when there is a change on this specific cell it will
prompt the user for a password?

I'm new, I already have this code: (but it's not working)

Private Sub Worksheet_Change(ByVal C19 As Range)
Set pass = Application.InputBox(prompt:="Enter a Password", Type:=2)
End Sub

I found events only on workbook and worksheet but nothing on a specific
cell. Do you think this is possible? Help!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Change Event on a Specific Cell

It worked, thank you so much! :)
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Change Event on a Specific Cell

You're welcome. Thanks for the feedback.

"Sashi" wrote:

It worked, thank you so much! :)

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
change the width of a specific cell Andrew Excel Worksheet Functions 3 October 14th 06 12:19 AM
change event on specific cell rather than worksheet frendabrenda1 Excel Discussion (Misc queries) 10 September 21st 06 03:37 AM
Event macro that targets specific worksheet retseort Excel Discussion (Misc queries) 3 February 20th 06 02:47 PM
cell change event gvm Excel Worksheet Functions 3 September 20th 05 04:50 AM
cell value change event alinasir Excel Worksheet Functions 1 August 30th 05 10:57 AM


All times are GMT +1. The time now is 12:16 PM.

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"