# Thread: LAST free cell in row

1. How to have the number of last free cell in range A2:IV2...
In this my case 4 (D2 is the free last cell)

2. You can use

LastCol = Range("IV2").End(xlToLeft).Column + 1

or if you want to be certain it'll work in Excel 2007 and later too:

LastCol = Cells(2, Columns.Count).End(xlToLeft).Column + 1

3. [quote name='HansV' post='761383' date='25-Feb-09 13:09']You can use

LastCol = Range("IV2").End(xlToLeft).Column + 1

or if you want to be certain it'll work in Excel 2007 and later too:

LastCol = Cells(2, Columns.Count).End(xlToLeft).Column + 1[/quote]
good!

4. [quote name='sal21' post='761380' date='25-Feb-2009 12:58']How to have the number of last free cell in range A2:IV2...
In this my case 4 (D2 is the free last cell)[/quote]

Doing it by means of a formula:

Control+shift+enter, not just enter...

=MATCH(2,1/(1-ISBLANK(A2:IV2)))+1

If A2:IV2 is empty (unused), the result will be #N/A.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•