Hi,
Below I have posted my commented code. My primary problem at the moment is that within the function I have an IF statement (the VLOOKUP I achieved by recording a macro and works) and an Else. If the function goes into the else I want it to call my Main Sub. However, none of my code within my ELSE works within the ELSE....it works if I move it above the IF (just under all my DIM's). I don't know if I am missing a rule of VBA or something similar.....but all help is appreciated!!
Secondly... if this can be done it would be really helpful...I would like it if the value I am looking up in my VLOOKUP was the cell that the user selected as the Dependency. I have tried entereing Dependency.Address...changing Dpeendency to 'as range'....trying to take the range beforehand putting it into the VLOOKUP and tried ActiveCell.Offset(0,-2)...unsuccesfully! Because at the moment, for the VLOOKUP to work (if the Dependency qualifies in the IF) then I would need to drag the formula down in the worksheet to get the correct value I am looking up....I can't just enter the formula in a cell (say halfway down my worksheet) as it will VLOOKUP on the cell 'RC[-7]'.
I have attached an example workbook to help with the understanding of what I'm trying to do... Thanks
P.S the million MsgBoxs within my code I have commented out are from when I have been trying to debug!
Bookmarks