Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 788
Default Function isn't recalculating

Hi guys, I have a function running in my workbook and it won't recalculate
automatically. I have an idea this is because it's being used 365 times on
one sheet. Is there any way to make this update automatically or do I need
to redesign this thing again?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 788
Default Function isn't recalculating

I've tried using Application.Volatile and I've made sure that updates are set
to automatic already.. Is there a way to turn the following UDF into a normal
function?

Function SalesTotal() As Integer
Application.Volatile
Dim varDate As Date
Dim c As Range
varDate = ActiveCell.Offset(-1).Value
SalesTotal = 0
LastRow = Sheet19.Cells(Rows.Count, "M").End(xlUp).Row
Set MyRange = Sheet19.Range("M1:M" & LastRow)
For Each c In MyRange
If c.Value = varDate Then
SalesTotal = (SalesTotal + c.Offset(, 2).Value)
End If
Next
If IsError(SalesTotal) Then SalesTotal = 0
End Function

"Chris" wrote:

Hi guys, I have a function running in my workbook and it won't recalculate
automatically. I have an idea this is because it's being used 365 times on
one sheet. Is there any way to make this update automatically or do I need
to redesign this thing again?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default Function isn't recalculating

varDate = ActiveCell.Offset(-1).Value

I think your problem is in your use of ActiveCell... that may not be
pointing to what you think it is point to. I'm guessing you want to
reference the cell above the cell the UDF is in... if that is correct, then
try replacing the above line from your code with this line...

varDate = Application.Caller.Offset(-1).Value

--
Rick (MVP - Excel)


"Chris" wrote in message
...
I've tried using Application.Volatile and I've made sure that updates are
set
to automatic already.. Is there a way to turn the following UDF into a
normal
function?

Function SalesTotal() As Integer
Application.Volatile
Dim varDate As Date
Dim c As Range
varDate = ActiveCell.Offset(-1).Value
SalesTotal = 0
LastRow = Sheet19.Cells(Rows.Count, "M").End(xlUp).Row
Set MyRange = Sheet19.Range("M1:M" & LastRow)
For Each c In MyRange
If c.Value = varDate Then
SalesTotal = (SalesTotal + c.Offset(, 2).Value)
End If
Next
If IsError(SalesTotal) Then SalesTotal = 0
End Function

"Chris" wrote:

Hi guys, I have a function running in my workbook and it won't
recalculate
automatically. I have an idea this is because it's being used 365 times
on
one sheet. Is there any way to make this update automatically or do I
need
to redesign this thing again?


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
TABLE function - not recalculating correctly Jacob Excel Worksheet Functions 7 November 16th 07 07:44 PM
If Statement not recalculating Bagia Excel Worksheet Functions 3 April 12th 07 03:32 PM
EXCEL2000 trouble with SUM function recalculating on new data ent huskybytes Excel Worksheet Functions 2 March 10th 06 04:17 PM
Using the NOW() function without it recalculating Sean C Excel Worksheet Functions 3 January 16th 06 10:52 PM
Recalculating problem. Twrchtrwyth Excel Discussion (Misc queries) 3 August 28th 05 07:58 AM


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

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"