+ Reply to Thread
Results 1 to 3 of 3

If event When a specific cell changes

  1. #1
    Registered User
    Join Date
    08-19-2004
    Posts
    3

    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.

  2. #2

    Re: 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



  3. #3
    Registered User
    Join Date
    08-19-2004
    Posts
    3

    It worked

    Hello

    Thank you for the quick reply. your suggestion worked great. Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1