Worksheet Function to Find First Cell With Contents in a Ran

MattHyatt

New Member
Joined
Oct 13, 2002
Messages
6
I have a range A1:A100, sometimes with five rows of data, and sometimes with 95 rows of data. I know how to find the first empty row in the range using a macro (thanks to MrExcel), but I would like to get the same information with a worksheet function. Any suggestions?
 
On 2002-10-14 17:56, MattHyatt wrote:
Well, I thought I was home-free, but I'm not. It works fine with numbers, but when I went back to my "real world scenario", I found that it doesn't work when the array is full of text.

There must be some way to get MATCH to convert the text to numbers. Maybe MID or LEN or something. Going back to do some more research. Additional comments welcome.

Thanks!


=MATCH(REPT("z",90),A:A)

will give the row number if col A is of text type.

If col A is of mixed data type (text & numbers), use:

=MAX(MATCH(9.99999999999999E+307,A:A),MATCH(REPT("z",90),A:A))
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,224,800
Messages
6,181,045
Members
453,014
Latest member
Chris258

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top