+ Reply to Thread
Results 1 to 4 of 4

Execute Macro

  1. #1
    Yves
    Guest

    Execute Macro

    Hello,
    Is there a way to execute a macro in a formula ??
    For example a need to execute a macro if the value in a cell is out of
    range.
    Many thanks for your help
    Yves




  2. #2
    JulieD
    Guest

    Re: Execute Macro

    Hi

    not directly, you can however, put worksheet change code against the sheet
    to read the result of the formula and run appropriate code, e.g.
    ------
    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = "$A$1" And Target.Value < 4 Then
    Application.EnableEvents = False
    Call Macro1
    Application.EnableEvents = True
    End If

    End Sub

    -------

    if you'ld like help implementing something along these lines, please post
    back with additional information

    --
    Cheers
    JulieD
    check out www.hcts.net.au/tipsandtricks.htm
    ....well i'm working on it anyway
    "Yves" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    > Is there a way to execute a macro in a formula ??
    > For example a need to execute a macro if the value in a cell is out of
    > range.
    > Many thanks for your help
    > Yves
    >
    >
    >




  3. #3
    Yves
    Guest

    Re: Execute Macro

    Hi,
    Many thanks for your answer, it works very well
    Regards.
    Yves


    "JulieD" <[email protected]> a écrit dans le message de news:
    %[email protected]...
    > Hi
    >
    > not directly, you can however, put worksheet change code against the sheet
    > to read the result of the formula and run appropriate code, e.g.
    > ------
    > Private Sub Worksheet_Change(ByVal Target As Range)
    >
    > If Target.Address = "$A$1" And Target.Value < 4 Then
    > Application.EnableEvents = False
    > Call Macro1
    > Application.EnableEvents = True
    > End If
    >
    > End Sub
    >
    > -------
    >
    > if you'ld like help implementing something along these lines, please post
    > back with additional information
    >
    > --
    > Cheers
    > JulieD
    > check out www.hcts.net.au/tipsandtricks.htm
    > ...well i'm working on it anyway
    > "Yves" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hello,
    >> Is there a way to execute a macro in a formula ??
    >> For example a need to execute a macro if the value in a cell is out of
    >> range.
    >> Many thanks for your help
    >> Yves
    >>
    >>
    >>

    >
    >





  4. #4
    JulieD
    Guest

    Re: Execute Macro

    you're welcome and thanks for the feedback


    "Yves" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    > Many thanks for your answer, it works very well
    > Regards.
    > Yves
    >
    >
    > "JulieD" <[email protected]> a écrit dans le message de news:
    > %[email protected]...
    >> Hi
    >>
    >> not directly, you can however, put worksheet change code against the
    >> sheet
    >> to read the result of the formula and run appropriate code, e.g.
    >> ------
    >> Private Sub Worksheet_Change(ByVal Target As Range)
    >>
    >> If Target.Address = "$A$1" And Target.Value < 4 Then
    >> Application.EnableEvents = False
    >> Call Macro1
    >> Application.EnableEvents = True
    >> End If
    >>
    >> End Sub
    >>
    >> -------
    >>
    >> if you'ld like help implementing something along these lines, please post
    >> back with additional information
    >>
    >> --
    >> Cheers
    >> JulieD
    >> check out www.hcts.net.au/tipsandtricks.htm
    >> ...well i'm working on it anyway
    >> "Yves" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hello,
    >>> Is there a way to execute a macro in a formula ??
    >>> For example a need to execute a macro if the value in a cell is out of
    >>> range.
    >>> Many thanks for your help
    >>> Yves
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
    >




+ 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