Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default UDFs needed I think they're pretty easy but I can't figure them ou

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!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default UDFs needed I think they're pretty easy but I can't figure them ou

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

will count if blank
--

Regards,

Halim


"Still Learning" wrote:

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!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default UDFs needed I think they're pretty easy but I can't figure them ou

Start from this and add :

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

NickHK

"Still Learning" ...
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!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy/Paste cell down to next value- Easy question, can't figure it J. Catz. Excel Discussion (Misc queries) 2 November 4th 09 10:45 AM
Easy Problem that I can't figure out Cory from Eugene[_2_] Excel Discussion (Misc queries) 2 September 3rd 07 02:37 AM
Formula needed to show the second to last figure in range of cells Sarah (OGI) Excel Worksheet Functions 3 August 2nd 07 08:04 AM
Pretty easy If loop - help!! nemadrias Excel Worksheet Functions 9 July 7th 06 12:13 AM
Maybe an easy If / Then statement? But I can't figure it out. Help! Dave Peterson[_3_] Excel Programming 1 January 27th 04 03:22 AM


All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"