LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Copied function is not working

See my response to your other post.

Greg

"CJ" wrote:

In my spreadsheet, I have a module where the following working functions
previously existed:

Function GetPass(TR As Range) As Integer
Dim i As Integer, c As Integer
For i = 1 To TR.Count
If Trim(LCase(TR.Cells(i, 1))) = "pass" Then
c = c + 1
End If
Next i
GetPass = c
End Function
-----------------------------------------------
Function GetFail(TR As Range) As Integer
Dim i As Integer, c As Integer
For i = 1 To TR.Count
If Trim(LCase(TR.Cells(i, 1))) = "Fail" Then
c = c + 1
End If
Next i
GetFail = c
End Function
-----------------------------------------------
Function GetToDo(TR As Range) As Integer
Dim i As Integer, c As Integer, d As String
For i = 1 To TR.Count
If Trim(LCase(TR.Cells(i, 1))) = "to do" Then
c = c + 1
End If
Next i
GetToDo = c
End Function
-----------------------------------------------
Function GetTotal(TR As Range) As Integer
GetTotal = TR.Count
End Function

**********
I needed to further define a "fail" status so I renamed fail to bug in the
above function. Then I copied that function and defined it for each of my
other fail types. (Blocked, Warning, Design) - see below:

Function GetBlocked(TR As Range) As Integer
Dim i As Integer, c As Integer, d As String
For i = 1 To TR.Count
If Trim(LCase(TR.Cells(i, 1))) = "Blocked" Then
c = c + 1
End If
Next i
GetBlocked = c
End Function
-----------------------------------------------
Function GetWarning(TR As Range) As Integer
Dim i As Integer, c As Integer, d As String
For i = 1 To TR.Count
If Trim(LCase(TR.Cells(i, 1))) = "Warning" Then
c = c + 1
End If
Next i
GetWarning = c
End Function
-----------------------------------------------
Function GetDesign(TR As Range) As Integer
Dim i As Integer, c As Integer
For i = 1 To TR.Count
If Trim(LCase(TR.Cells(i, 1))) = "Design" Then
c = c + 1
End If
Next i
GetDesign = c
End Function
*******************

In my spreadsheet I have a variable called OTStatus that defines a range of
cells. Then at the top of my spreadsheet I have a call that tallies the
occurence of each of the statuses (Pass, Bug, To Do, Design, Blocked, etc).
This formula is GetPass(OTStatus).
The issue that I'm having is that the functions I copied and modified are
not working in my spreadsheet. For instance in my range (OTStatus) I have
one occurence of Bug, however the cell that is defined with formula:
GetBug(OTStatus), it shows a count of 0. Copying the code for the function
does not appear to be working.

I would be ever so grateful if someone could help. I'd gladly send you my
spreadsheet to help show you what I'm trying to explain! :)

Thank you so kindly in advance!!



 
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
Working Days function copied down column Mally Excel Discussion (Misc queries) 1 July 23rd 09 07:24 AM
Copied graphs not working Keith R Charts and Charting in Excel 3 June 4th 07 12:51 PM
Copied hyperlink not working jinx Excel Worksheet Functions 4 April 30th 07 04:04 PM
Newly created Get Function is not working when I copied the syntax from a working function CJ Excel Programming 1 January 16th 07 05:28 AM
Copied worksheet not working [email protected] Excel Discussion (Misc queries) 0 June 15th 06 08:01 PM


All times are GMT +1. The time now is 04:27 PM.

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

About Us

"It's about Microsoft Excel"