Results 1 to 3 of 3

Thread: Autorun

  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Autorun

    I have a button on my worksheet that runs a macro on click. I would now like to run that macro each time I change the value of cell B4

    Can somebody please tell me how to do this?

    Thanks, Simon

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autorun

    Insert this in the sheet object (i.e. not the module):
    <pre>Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If Target.Cells(1, 1) = Range("B4") Then YourMacroNameHere
    End Sub
    </pre>

    HTH

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    113
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autorun

    Thanks, works a treat

    Simon

Posting Permissions

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