klandreth
08-23-2012, 01:37 AM
Hi! Learning more and more about VBA everyday! :cloud9: But I don't understand this line of code (written by my predecessor):
Dim lRow as long, rCell as Range
.
.
.
For each rCell in Intersect(Target, Columns("O"))
.
.
.
lRow = rCell.row
.
.
.
range("O2:O2").offset(lRow - 2).interior.color = vbRed
.
.
.
.
next RCell
I get what he's trying to do .... turn the cell RED, but I don't understand the "offset(lRow - 2)" :banghead:
Isn't there a clearer way of specifying this? (Note: the worksheet has two header rows that are ignored throughout processing by starting at either row 3 or subtracting 2 from the total number of rows/last row position.)
Thanks for the service you provide.:beerchug:
Dim lRow as long, rCell as Range
.
.
.
For each rCell in Intersect(Target, Columns("O"))
.
.
.
lRow = rCell.row
.
.
.
range("O2:O2").offset(lRow - 2).interior.color = vbRed
.
.
.
.
next RCell
I get what he's trying to do .... turn the cell RED, but I don't understand the "offset(lRow - 2)" :banghead:
Isn't there a clearer way of specifying this? (Note: the worksheet has two header rows that are ignored throughout processing by starting at either row 3 or subtracting 2 from the total number of rows/last row position.)
Thanks for the service you provide.:beerchug: