Consulting

Results 1 to 3 of 3

Thread: Solved: On sheet change macro.

  1. #1
    VBAX Regular
    Joined
    Mar 2007
    Posts
    9
    Location

    Solved: On sheet change macro.

    Hi,
    I have a requirement to have a macro run when ever someone clicks/or changes worksheet on the next tab within a workbook (which has many tabs). This is going to be a prompt that reminds them to do certain things when they are in that worksheet.

    I remember this sometime ago, but cannot remember what actually activates a macro on worksheet change..

    Cheers
    Chris

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    'do your stuff
    End Sub
    [/vba]

    This is workbook event code.
    To input this code, right click on the Excel icon on the worksheet
    (or next to the File menu if you maximise your workbooks),
    select View Code from the menu, and paste the code
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Mar 2007
    Posts
    9
    Location
    Hi,
    Many thanks for that... great.
    Cheers
    Chris

Posting Permissions

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