Get last column

L

Les Stout

Hi all, i need to get the last used column, as it can be a variable
amount of columns, so that i can autofit them. Can somebody help me out
my misery please... :-0)

Best regards,

Les Stout
 
G

Guest

This assumes row 1 is your longest row.

lastCol = Cells(1, Columns.Count).End(xlToLeft).Column
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top