View Single Post
  #28   Report Post  
Posted to microsoft.public.excel.programming
Daniel Petta Daniel Petta is offline
external usenet poster
 
Posts: 5
Default Logical based Horizontal Lookup

Hello Claus,

I've taken your code and updated my UDF but have found that it isn't rectifying the issue but I wonder if making this change will only affect the formula being used going forward and not update previous issues.

For example, I've gone into an existing file and updated the mytime UDF to the following:

http://pastebin.com/sPPbkiTt

When I update the UDF, save and exit from Visual Basic I can still see schedules showing in future weeks although there is no detailed schedule to support it.

Now what I've found is that when these "ghost" schedules showing up in future summaries they will go away when you select the cell, click F2 to access the formula and then hit enter. So it would seem as though the mytime formula works, it just needs to be forcibly recalculated.

I don't know if this is happening based on any of the following:
* all of the sheets and cells in question are "locked" via the protection set up in excel to avoid the user from modifying the formulas.

Based on this I've developed the following work around. When you have to print the summary I use a macro that effectively filters out those staff who do not have any hours for the week and only shows those who have a detailed schedule. What I've found is that the filtering process I have in this macro effectively clears these "ghost" summary schedules and prints correctly.. Here is the macro I have set up to do this:

http://pastebin.com/Azp2v9QJ

It would appear that the filtering mechanism is effectively "forcing" the mytime formulas to recalculate. I get a similar result when I 1) unprotect the sheet, 2) select a cell with the mytime formula, 3) hit F2 to select the cell's mytime formula and then 4) click enter to exit from the formula. Again, seems to be forcing the mytime formula to complete.

I have a work around which is OK for when you print the summary schedule but when you look at future weeks those "ghost" summary schedules are still there.

Very odd one, not sure what attributes to this but wanted to feedback in case you had any other ideas.

Thanks again,

Daniel