Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default If event When a specific cell changes


Hello

I have a workbook that is shared with many users and it can NOT be
password protected but I want to control the data in cells F45 and G45.
The VB I have works for F45 but I cant duplicate it for cell G45


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target = Cells(45, 6) Then Cells(45, 6) = "n/a"
End Sub

Currently when ever someone enters anything in cell F45 it changes back
to n/a as soon as they press enter.


--
nuclearjack
------------------------------------------------------------------------
nuclearjack's Profile: http://www.excelforum.com/member.php...o&userid=13355
View this thread: http://www.excelforum.com/showthread...hreadid=573346

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default If event When a specific cell changes

Hi,
Try this :
I've modified this from Ogilvy code :
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
If Target.Address = "$F$45" Then
If Target.Value < "n/a" Then Target.Value = "n/a"
End If
End Sub

or have a look at :
http://groups.google.co.id/group/mic...0a588ace130544

Rgds,

halim

nuclearjack menuliskan:
Hello

I have a workbook that is shared with many users and it can NOT be
password protected but I want to control the data in cells F45 and G45.
The VB I have works for F45 but I cant duplicate it for cell G45


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target = Cells(45, 6) Then Cells(45, 6) = "n/a"
End Sub

Currently when ever someone enters anything in cell F45 it changes back
to n/a as soon as they press enter.


--
nuclearjack
------------------------------------------------------------------------
nuclearjack's Profile: http://www.excelforum.com/member.php...o&userid=13355
View this thread: http://www.excelforum.com/showthread...hreadid=573346


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 an event upon changing the value of a specific cell? Wael Fathy Excel Worksheet Functions 1 February 23rd 10 02:04 PM
Event when a specific cell changes mohavv Excel Discussion (Misc queries) 1 August 25th 08 10:29 PM
Change Event on a Specific Cell Sashi Excel Worksheet Functions 3 July 20th 07 11:12 PM
change event on specific cell rather than worksheet frendabrenda1 Excel Discussion (Misc queries) 10 September 21st 06 03:37 AM
Worksheet_Change Event triggered off specific cell ExcelMonkey[_142_] Excel Programming 2 June 7th 04 03:33 AM


All times are GMT +1. The time now is 09: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"