Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Activating a Macro everytime the value in a Worksheet "Cell"

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi All,

    I have a worksheet in which I need to run a macro everytime the value in a cell (say Cell B1) is changed.
    [Note: The calculation mode in the workbook is required to stay manual]
    I know that I can do this using a TextBox, but I am trying to see if I can do without it to preserve the look and feel of the worksheet. Uning a text box would work for me, provided I could embed the textbox in cell B1 such that a Tab press in cell A1 could move me to the text box. I've run out of ideas on this and would really appreciate your help. Thanks!

    Manish

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Las Vegas Nevada USA
    Posts
    239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try this

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)

    ' Level 1: Set up the event to watch a single cell.
    If Target.Address = Range("VB_Trigger").Address Then

    ' Level 2: Perform some action based on the value of the watched cell.
    Select Case Target.Value
    Case 1
    MsgBox "Hello"
    Case 2
    MsgBox "Goodbye"
    Case 3
    MsgBox "Pretty Bird"
    End Select

    End If

    End Sub
    George

    Learn to listen. Opportunity sometimes knocks very softly.

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    George,

    Thank you very much!
    That did the job!

    Regards,

    Manish

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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