+ Reply to Thread
Results 1 to 4 of 4

Auto Update in excel

  1. #1

    Auto Update in excel

    I need to know how to have my validation macro run everytime i change
    the contents of a cell. I've tried putting the macro name in the
    Worksheet_Change Source but it seems to be stuck in a loop. Any help?


  2. #2
    Tim Williams
    Guest

    Re: Auto Update in excel

    If your macro is updating the sheet then that will again cause the Change
    event to fire.

    Try something like this in the change event:


    '*******************************
    Static bInProgress as boolean

    if bInProgress then exit sub

    bInProgress=True

    '..... do your stuff

    bInProgress=False
    '*******************************

    --
    Tim Williams
    Palo Alto, CA


    <[email protected]> wrote in message
    news:[email protected]...
    > I need to know how to have my validation macro run everytime i change
    > the contents of a cell. I've tried putting the macro name in the
    > Worksheet_Change Source but it seems to be stuck in a loop. Any help?
    >




  3. #3
    Mark
    Guest

    Re: Auto Update in excel

    Try This, just change the address between the quotes to suit your
    needs.

    Private Sub Worksheet_Change(ByVal Target As Range)

    On Error GoTo DoNothing
    If Target.Address = "$A$1" Then
    MsgBox "This works"
    End If
    Exit Sub

    DoNothing:

    End Sub


    This will avoid running into a continuos loop


  4. #4
    wdjsxj
    Guest

    RE: Auto Update in excel

    before the end of your macro,
    a1=11 or something


    [email protected]”编写:

    > I need to know how to have my validation macro run everytime i change
    > the contents of a cell. I've tried putting the macro name in the
    > Worksheet_Change Source but it seems to be stuck in a loop. Any help?
    >
    >


+ 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