How to Modify Worksheet Range when called by a UDF

M

Michael Franz

Hi,

I have been spinning my wheels trying to figure out how to solve my problem.
I am not sure if using a UDF is the correct solution. I have read that UDF
cannot modify worksheets if they are called in a certain way, but can if they
are called another way. I have read about Excel Addins, COM Addins and UDFs
and feel confused on which of these will provide the solution.

What I want to do is provide a funtion that a user can use that will take in
parameters, and then return the result by modifing a range of cells. One of
the parameters passed in will be the starting cell for the resulting range.

I need to write most of this code (if not all) in C# (VB.NET). We are
trying to limit the amount of VBA code that we need in our solution.

Being pointed in the right direction is greatly appreciated.

Michael
 
J

Jim Thomlinson

The question is how is the function called.
If the function is called by adding a formula to a cell then it can only
modify the value of the cell that it is in. Similar to any function in XL
such as sum or average it's scope is limited to the cell that it is in.
If however the function is called using a command button or event then a
function has free reign to do whatever it wants to any number of cells in any
number of sheets.
 
M

Michael Franz

Jim,

Does wrapping the UDF in VBA also give it the ability to do whatever it wants?

Would an RTD server also be able to do whatever it wants?

Thanks

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top