code for col number of last used cell in a row

J

Jack Sons

Hi all,

I knew it once, but I didn't program for a long time:
What is the best code to get the column number (number!) of the last non
blank cell in a row?
TIA

Jack Sons
The Netherlands
 
M

Mike H

Hi

The 1 represents row 1 so change to suit

LastCol = Cells(1, Columns.Count).End(xlToLeft).Column
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 

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