Bill
Should be :- End(xlToLeft)
You could have got this by using the macro recorder.
Celia
PS. Does your code work exactly as you've typed it (with "row" and "column" at the end)? This doesn't look right to me.
Try this:
FinalRow = Range("A65536").End(xlUp).Row
do While cells(FinalRow,1) = ""
FinalRow = FinalRow - 1
Loop
FinalColumn = Range("IV1").End(xlToLeft).Column
Do While Cells(1,FinalColumn) <> ""
FinalColumn = FinalColum - 1
Loop
End Sub
Jeff.
Celia,
Yes your right and I found that I did make an error when I posted the message. I forgot to add Trim to the statement. In the past, I found that "FinalRow = Range("A65536").End(xlUp).Row" always didn't work due to cells that looked emty but were not due to unseen spaces in the cell.
FinalRow = Range("A65536").End(xlUp).Row
do While trim(cells(FinalRow,1)) = ""
FinalRow = FinalRow - 1
Loop
FinalColumn = Range("IV1").End(xlToLeft).Column
Do While trim(Cells(1,FinalColumn)) <> ""
FinalColumn = FinalColum - 1
Loop
End Sub
Jeff.