UDFs needed I think they're pretty easy but I can't figure them ou

G

Guest

All of this explanation assumes that the UDF will only look at one row so by
range I mean a specified number of columns in the same row that are all
clumped together (no breaks in the range).

I need a UDF that can be dragged down to start in cell D2 that will look at
a range in the row that the formula will be on (the range could be E2 to J2
for example) that will look for the first cell in that range that has a value
and from there count the number of blank cells until the end of the range
(not the last cell with a value, I want it to count the blank cells all the
way to the end of the specified range).

Then I need a UDF that will count the total number of cells in a row that
will find the first cell in the range that has a value and count the number
of cells until the end of the range (again all the way to the end, not the
last cell with a value)

Finally I need a UDF that will find the last cell in a range that has a
value and count the number of blank cells to the end of the range

I'm pretty sure all three of these are similar I just can't figure out how
to start this. Thank you in advance for your help!
 
G

Guest

Hi,
Try this :
Sub Test()
Debug.Print Application.CountIf(Range("A1:A100"), "")
End Sub

will count if blank
 
N

NickHK

Start from this and add :

Public Function RowNumber() As Long
RowNumber = Application.Caller.Row
End Function

NickHK
 

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