Hi

I have the following code to find the last non-empty column:

Dim Lc as long

Lc = Sheet2.Cells(1, Columns.Count).End(xlToLeft).Column
This is column H in this case (column number 8) so LC returns 8 but it may be column M tomorrow so I can't hardcode this.
I want to select and then autosize columns A to the last column.

What is the code to do this?

I tried Columns("A:"Lc).select but no luck there. Tried a few others too.

cheers