I would have expected this to work, but you might not have time to play
about.
So simply move the function to a code module and call it from both sheets.
Note that you haven't said what the actual "didn't work" was, so I'm not
sure how you expect us to guess the answer. What precisely went wrong?
Remember that the active sheet would be OutputSheet, not DataSheet, when the
function was executed in this way.