View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default sloppy code help

test = ownershp(midd, site)
Range("a" & i).Value = team
Range("b" & i).Value = owner

so i built a UDF ownershp() that returns two different variables
(team and owner) based on two other variables (parent site, child
midd). currently, i have to use the test = line to run the function.
variables team and owner are public so that my code can use them in
the main sub as well as the udf. how can i clean it up to not need to
use the test = line? test does nothing else other than allow me to
call the udf and it bugs me... there has to be a better way


A UDF is a custom cell function that returns a result to the cell using
it! Nor can you use a UDF to affect change in other cells, only the
cell using it in a formula.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion