hello, i found this code somewhere written by jon peltier
i am curious to learn, what is the role .Parent here what exactly parent do here. if it was used without .parent wouldn't it work?
also my second question, why IIF with double i is used here. what is the difference between if with one i and with double ii
wouldn't this work if it was if with single i?
i am curious to learn, what is the role .Parent here what exactly parent do here. if it was used without .parent wouldn't it work?
also my second question, why IIF with double i is used here. what is the difference between if with one i and with double ii
wouldn't this work if it was if with single i?
Code:
[COLOR=#333333][FONT=inherit]Function LastCol(rTest As Range) As Long[/FONT][/COLOR] Dim lTest As Long
Dim iRow As Range
For Each iRow In rTest.Rows
With rTest.Parent.Cells(iRow.Row, "IV")
lTest = IIf(.End(xlToLeft).Column > lTest, .End(xlToLeft).Column, lTest)
End With
Next
LastCol = lTest [COLOR=#333333][FONT=inherit]End Function[/FONT][/COLOR]