Results 1 to 6 of 6
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Triggering a Macro in Excel 95

    Is there a way to trigger starting a macro when the user enters data in a particular cell?
    I'd like them to enter the info and launch a formatting macro automatically.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering a Macro in Excel 95

    There is a Change event for each worksheet that is triggered every time there is a change in any cell of the sheet it is attached to. There is also a workbook sheetchange event that is triggered every time any cell in the workbook is changed. In the event routine, your code has to check to see if the cell that changed is the one you are interested in
    Legare Coleman

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Triggering a Macro in Excel 95

    I thought I was following really well, until you mentioned the event routine. Care to expand, or give an example?
    Thanks
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering a Macro in Excel 95

    As far as I know workbook and worksheet events are new since Excel 97 and are not available in Excel 95.

  5. #5
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering a Macro in Excel 95

    If Hans is correct, and I don't have any reason to think that he is not, then my suggestion will not work. It has been quite a while since I worked with Excel 95.
    Legare Coleman

  6. #6
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Triggering a Macro in Excel 95

    I looked it up for you. There should be a particular trappable event called 'OnEntry' that can execute a subroutine when data is entered or edited in a cell.

    e.g. Sheets("Sheet1").OnEntry = "StartYourMacro"

    I don't know if it is possible to make this work if data is entered in a particular cell on Sheet1. I don't have Excel 95 so I cannot try it out, but you should find more information in the on-line help if you search for 'OnEntry' or other events such as 'OnDoubleClick'. I think you can place this statement in the Auto_Open subroutine which is automatically fired when the workbook is opened. Sorry that I can't be of much more help but Excel 95 is something that I try to avoid working with as there are so many features that do not exist or don't work as compared to Excel 97 or 2000.

Posting Permissions

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