Create "Name" in UDF

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to create a UDF, and then in my VBA I create a "Name" for the calling
cell, is it possible?

E.g. =GetTotal ( my UDF will return a VALUE, as well as name "that" cell as
"SomeText")

Thanks,
 
Hi Peter,

A UDF returns a value to the calling cell; it cannot alter its environment.

If you want to name a cell, you will need to use an appropriate sub.
 
Hi,

I can't see how you can do it directly in the function, as you can't pass
the cell as a parameter (you get a circular reference).

However you could trap the 'Worksheet_Change' event on a worksheet & set
names up depending on if the Target returned contained you type of formula
.... not what you want but it may be a work-around.

Regards,

Chris.
 

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

Similar Threads


Back
Top