MsDeth
New Member
- Joined
- May 8, 2004
- Messages
- 41
I'm sure this has been asked/answered before, but had no luck searching the forum.
Is there a way to condense this:
Into something along the lines of
or
I realize the "AND" or "THROUGH" won't do the trick, just trying to make it obvious what I'm trying to accomplish...I'd like to "condense" the code a bit.
Any help appreciated!
-MsDeth
Is there a way to condense this:
Code:
If ActiveCell = "V" Then
With ActiveCell.Interior: .colorindex = 19
With ActiveCell.Offset(0, -1): .Interior.colorindex = 19
With ActiveCell.Offset(0, 1): .Interior.colorindex = 19
With ActiveCell.Offset(0, 2): .Interior.colorindex = 19
With ActiveCell.Offset(0, 3): .Interior.colorindex = 19
With ActiveCell.Offset(0, 4): .Interior.colorindex = 19
'etc., etc.
Code:
If ActiveCell = "V" Then
With ActiveCell.Interior AND ActiveCell.Offset(0,-1) _
AND etc., etc.: .Interior.colorindex = 19
Code:
If If ActiveCell = "V" Then
With ActiveCell.Offset (0,-1) THROUGH ActiveCell.Offset(0,4) _
:.Interior.colorindex = 19
I realize the "AND" or "THROUGH" won't do the trick, just trying to make it obvious what I'm trying to accomplish...I'd like to "condense" the code a bit.
Any help appreciated!
-MsDeth