+ Reply to Thread
Results 1 to 2 of 2

Automatically run macro on sheet change

  1. #1
    Steven
    Guest

    Automatically run macro on sheet change

    Is there a way to put a macro or vb code on a Sheet's code that will
    automatically run when there is a change in the sheet. I tried to put code
    by itself but it gave me an error message saying "Invalid Outside Procedure".

    Thanks for your help.


  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening Steven

    When you say "a change in the sheet" do you mean when the sheet is changed or when the user changes sheets? If the former, which I suspect, try this, inserted in the relevant sheet's code section.

    Private Sub Worksheet_Change(ByVal Target As Range)

    ' Your code can go in here

    End Sub

    Your macro would then trigger every time that particular sheet is changed.

    HTH

    DominicB

+ 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