Consulting

Results 1 to 3 of 3

Thread: execute macro if change to range

  1. #1

    execute macro if change to range

    I am trying to write a piece of code that says if a change is made to cells C8, C9 or C10 then execute a macro I have written.

    I know how to do this for just one cell but not for a range of cells.

    Any help would be appreciated.

    Thanks

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    [VBA]Private Sub Worksheet_Change(ByVal Target As Range)
    Set xx = Intersect(Target, Range("C8:C10"))
    If Not xx Is Nothing Then
    For Each cll In xx.Cells
    MsgBox "doing somethibg wth cell " & cll.Address
    Next cll
    End If
    End Sub
    [/VBA]
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    thanks

Posting Permissions

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