Hello,
I have a code that references over 100 columns, and 9 rows deep. Basically, when a cell is double-clicked in one of these columns, the other row's cells in that column are erased. (A mutually exclusive 'selection').
The only problem is I want to add hidden columns and move ranges around and I'm wondering if there is a faster way of re-writing the code than repeating the following 'cases' 100 times (see,somewhat inelegant). Any ideas are most welcome!
Cheers!
M
Select Case Target.Address
Case Is = "$E$5", "$E$6", "$E$7", "$E$8", "$E$9", "$E$10", "$E$11", "$E$12", "$E$13"
'Clear Contents of cells that are not the target
'Asset 1, scenario 1
If Target.Address = "$E$5" Then [E6:E13].ClearContents
If Target.Address = "$E$6" Then [E5,E7:E13].ClearContents
If Target.Address = "$E$7" Then [E5:E6,E8:E13].ClearContents
If Target.Address = "$E$8" Then [E5:E7,E9:E13].ClearContents
If Target.Address = "$E$9" Then [E5:E8,E10:E13].ClearContents
If Target.Address = "$E$10" Then [E5:E9,E11:E13].ClearContents
If Target.Address = "$E$11" Then [E5:E10,E12:E13].ClearContents
If Target.Address = "$E$12" Then [E5:E11,E13].ClearContents
If Target.Address = "$E$13" Then [E5:E12].ClearContents
Bookmarks