code for col number of last used cell in a row

  • Thread starter Thread starter Jack Sons
  • Start date Start date
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
 
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.
 
Back
Top