Results 1 to 4 of 4
  1. #1
    3 Star Lounger Omega3's Avatar
    Join Date
    Jan 2004
    Location
    Los Angeles, California, USA
    Posts
    343
    Thanks
    2
    Thanked 1 Time in 1 Post

    Change Event (2002)

    I am using the Worksheet Change event for any cell that is modified in the worksheet. I have the following simple code in the event:

    If target.value =
    You know it's time to diet when you push away from the table and the table moves.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change Event (2002)

    The idea would be to loop through all cells in the Target range, but testing for any cell in a worksheet is a rather tall order. You could do something like this:

    Dim oCell As Range
    For Each oCell In Intersect(Me.UsedRange, Target)
    If oCell.Value = "" Then ...
    Next oCell

    This limits the loop to those cells in the Target range that fall within what Excel considers to be the used range of the worksheet (referred to as "Me").

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

    Re: Change Event (2002)

    <pre> If Target.Count > 1 Then Exit Sub
    </pre>

    Legare Coleman

  4. #4
    3 Star Lounger Omega3's Avatar
    Join Date
    Jan 2004
    Location
    Los Angeles, California, USA
    Posts
    343
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: Change Event (2002)

    Thank you Hans! The me.usedrange came in very handy. Legare's solution would also work but the me.usedrange also allows me to update mutiples cells at once via ctrl+enter and still execute the code in the change event. Thanks again.
    You know it's time to diet when you push away from the table and the table moves.

Posting Permissions

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