Code:MsgBox Cells(2, Columns.Count).End(xlToLeft).Column MsgBox Range("XFD8").End(xlToLeft).Column
=XLOOKUP(TRUE,10:10<>"",10:10,"",0,-1)
You might want to update your profile so we can see what version of Excel you are using.
If you have MS 365 XLookup returns the Cell, so this might work for you.
Excel Formula:=XLOOKUP(TRUE,10:10<>"",10:10,"",0,-1)