I'm getting that error at the Set SkillCatName = CatName line, I cannot see why. As help would be appreciated
![]()
Please Login or Register to view this content.
I'm getting that error at the Set SkillCatName = CatName line, I cannot see why. As help would be appreciated
![]()
Please Login or Register to view this content.
Last edited by RGrunden; 05-19-2012 at 09:43 PM.
Reality is stranger than fiction.
You don't use Set for strings/text. You use Set for objects like Workbooks, Worksheets, etc.
Regards, TMS
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
Are you calling that from the worksheet?
If you don't pass all of the arguments a function requires to return a result, Excel will not see a dependency, and will not automatically recalculate when the precedents change.
Entia non sunt multiplicanda sine necessitate
Yes the function is being called from a Worksheet and is inside a Module attached to the Workbook. Once I made the changes TMS suggested the error went away (changing Set to Let for the String and Integer variables). I know the formula as written in the Worksheet was passing all the required arguments. For completeness sake here is the formula as written into cell C3 of the Worksheet:
=IF(ISERROR(SkillCatCost($A3)),"",SkillCatCost($A3))
I left row as a relative reference because I wanted to be able to copy and paste that formula into other cells within the same column and have it reference the A column of the row it was in.
I don't think so.I know the formula as written in the Worksheet was passing all the required arguments.
Your code looks at data on other worksheets.
Last edited by shg; 05-21-2012 at 10:25 AM.
1) The code may look elsewhere but the function only requires one argument which is being pulled form another cell on the same worksheet.
2) All worksheets referenced in the code are in the same workbook to which the module is attached.
3) All referenced ranges have valid data fields.
4) The error went away when I changed the statements from Set to Let.
The error goes away, but if you change a value on wsCatData.Range("CatData_CatList"), the function doesn't automatically recalculate. Does that seem like correct behavior?
If you're fine with it, I'm fine.
The range referenced is on a Data page that will not be modified. So I'm ok with the function not recalculating if a value there changes, because they aren't meant to change.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks