View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default code for col number of last used cell in a row

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.


"Jack Sons" wrote:

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



.