View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RyanH RyanH is offline
external usenet poster
 
Posts: 586
Default Last Cell In Row

This is the fastest way to find the last column with a value in it for Row 1.
Just change the row number to find the last column with a value in it.

ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column

--
Cheers,
Ryan


"kirkm" wrote:

Found this vis Goggle

Sub LastCellInRow()

Range("IV1").End(xlToLeft).Select

End Sub


It says it gives you the last Cell in a row.

But I can't see where you tell it the row or how you see the result.

I know my highest col is "CP" or 94 and was going to use this -

for x = 94 to 1 step -1
if Cells(10,x) "" then Answer = x:Exit For
next x

Once the fisrt method is working, which is best ?

Thanks - Kirk