To keep the calculator visible while working on something else requires that the calculator be modeless. As my post hinted, I use a Mac, which doesn't support modeless Userforms, so I'm not familiar with that aspect of your project.
To use the UDF approach, forget about UserForm1 for the moment and simply create a UDF that returns the value from the Calculator.
What one could do is design the ufCalculator (userform) to keep it's return value in the ufCalculator.Tag and then have a UDF (in a normal module) something like
The first part of that is to see if ufCalculator has been shown and show it if not.
The second part tests the .Tag property for "control" values, that have values that you can set (vbNullString-intial (unused by user) value, False-Cancel pressed) etc.
There is no "transfer" of data from ufCalculator to any other form. There is a function returning a value. Code like this would be found in UserForm1. Or anyother routine that you want. (note the test for Cancel)
(I'm waiting for some clever person to post the VB code to get values from Excel's built-in calculator)
Bookmarks