I would use Union to for the multiple ranges you are writing about. Then, the Insersect can just be specified on Target (as now) and the union of the others. This will probably the most clean way of writing the code.
Just use a comma separated list inside the Range call. For example, here is a 3-area test using this method.....How should I alter this:
Code:If Intersect(Target, Range("C14:D59")) Is Nothing Then Exit Sub
to work for multiple ranges?
If Intersect(Target, Range("A3:C5,D4:F4,H6:H9")) Is Nothing Then Exit Sub
Why do you need to use the Union method?
I am doing this from memory (not always a good thing to do), but I think there is a 255 character limit for the text string argument to the Range property call.I am not sure, but maybe there is a limit to the string length in Rick's code example - what is in between the Range(). Again, not sure of that.
... the most clean way to write it .... I think it can be read easier ..... every other column could be easily done in a loop ......
With Union we could add some "error handling"