Can I refer to Rg in With Rg? I have a long statement, and I would like to pass the range specified in the WITH statement as a parameter. Is it possible?
With rg.OffSet(0, -1).Resize(ColumnSize:=1)
'set conditional format
Call SetConditionalFormat(rg.OffSet(0, -1).Resize(ColumnSize:=1))
'I tried this but it didn't work
Call SetConditionalFormat(.range)
End With
Of course, I could just repeat rg.OffSet(0, -1).Resize(ColumnSize:=1)or assign it to a variable, but I'm curious if such a thing exists, referring to itself.
source
share