Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2007
    Location
    The Farm
    Posts
    35

    Unanswered: help with Sub Worksheet_Change(ByVal Target As Range)

    I don't understand how you specify Target. The description suggest that Target can be a cell or range of cells so I assume there is a way to specify what you want. All the examples I have found assume the reader understands that part. I do not.

    What I want to do is recalculate when a particular row changes. Perhaps an example of a valid test to show it is working would be helpful also.

    Thanks.
    Bartron

    Liv'n down on the cube farm. Left, then another left, then right.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Moving to Excel forum - let me know if I missed something.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2007
    Location
    The Farm
    Posts
    35
    Did I create in the wrong forum? Sorry.
    Bartron

    Liv'n down on the cube farm. Left, then another left, then right.

  4. #4
    Join Date
    Feb 2007
    Location
    The Farm
    Posts
    35

    Still need help with WorkSheet_Change

    Attempting to re-signal need for help.
    Bartron

    Liv'n down on the cube farm. Left, then another left, then right.

  5. #5
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    Target is the range object of the currently selected/active Cell/Range when the worksheet that the module is in changes.

    ie

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        MsgBox Target.Address
    End Sub
    will display the address of the cell that has been changed, or the top left cell if it is a range of more that one cell.

    Hope that makes sense.



    MTB


    EDIT: and MsgBox Target.Row displays the current row number.

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Bartron
    Did I create in the wrong forum? Sorry.
    No probs
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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