#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default UDF #VALUE!

This function returns numbers when entered into the appropriate
cells. Then when other calculations are ran on other sheets, it bugs
out and changes to #VALUE! Can any one tell me why?

Thanks,
Jay
Function ThisThing(ItemNum As Range)
Dim InnerPack As Range, Pkgs As Range
Dim Match As Double, SumIt As Double
Set InnerPack = Sheet1.Range("W5", Sheet1.Range("W5").End(xlDown))
Set Pkgs = Sheet1.Range("D5", Sheet1.Range("D5").End(xlDown))
Match = InnerPack.Find(ItemNum.Value).Offset(0, -8).Value
SumIt = Application.SumIf(InnerPack, ItemNum, Pkgs)
ThisThing = Application.WorksheetFunction.RoundUp(RoundIt / Match,
0)
End Function
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default UDF #VALUE!

Nevermind. The last Roundit needed to change to a SUMIT and adding an
AS Double behind the function seems to have done the trick on fixing
the error.
Sorry,
Jay
Function ThisThing(ItemNum As Range)
* * Dim InnerPack As Range, Pkgs As Range
* * Dim Match As Double, SumIt As Double
* * Set InnerPack = Sheet1.Range("W5", Sheet1.Range("W5").End(xlDown))
* * Set Pkgs = Sheet1.Range("D5", Sheet1.Range("D5").End(xlDown))
* * Match = InnerPack.Find(ItemNum.Value).Offset(0, -8).Value
* * SumIt = Application.SumIf(InnerPack, ItemNum, Pkgs)
* * ThisThing = Application.WorksheetFunction.RoundUp(RoundIt / Match,
0)
End Function


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



All times are GMT +1. The time now is 12:29 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"