Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to run an event upon changing the value of a specific cell? | Excel Worksheet Functions | |||
Event when a specific cell changes | Excel Discussion (Misc queries) | |||
Change Event on a Specific Cell | Excel Worksheet Functions | |||
change event on specific cell rather than worksheet | Excel Discussion (Misc queries) | |||
Worksheet_Change Event triggered off specific cell | Excel Programming |