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: 216
Default Function and needing to Refresh

Hi. I've written the following simple function that
appears to work well. However, at various times I will
receive the #VALUE error and will need to hit F9
(recalculate) to get the correct answers. This happens
repeatedly if I open another workbook, change something,
and come back.

My code is:

Option Explicit

Function InviteBack(myType, myMonth)
Application.Volatile True
Dim myRange As range
Dim j As Integer
Set myMonth = Worksheets(myMonth)
Dim myCell As range
j = 0
Set myRange = myMonth.range("n4:n39")
For Each myRange In myRange.Cells
If myRange.Formula = myType Then
If UCase((myRange.Cells.Offset(0, 4).Formula))
= "Y" Then
j = j + 1
End If
End If
Next
InviteBack = j
End Function

Thanks,
Mike.
 
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
Table function, 2 variables. Problem with update/refresh lorenzo Excel Worksheet Functions 5 November 25th 06 10:55 PM
Refresh/Recalculate a Custom Function dch3 Excel Worksheet Functions 1 July 31st 06 01:59 PM
Customized function (in cell) does not refresh value :o( MarcL Excel Discussion (Misc queries) 3 February 28th 06 08:57 PM
student needing help w/vlookup function grading criteria Julie Excel Worksheet Functions 2 October 21st 05 01:13 PM
function values do not refresh Jacob Excel Worksheet Functions 2 April 1st 05 09:51 PM


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

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"