View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default DV Issues with IF statements. Call function instead?

You are asking for a UDF macro. The UDF gets update just like any other
worksheet function and gets called just like every other worksheet function.


=newfunction(A1, B2:B7, "hello",7)


function newfunction(Target1 as Range, Target2 as Range, NewString as
string, Strikes as Integer)

if NewString = "hello" and Strikes <= 6 then
newfunction = True
else
newfunction = False
end if

end function


"Maver1ck666" wrote:

I have a number of data validation fields which depending on their value,
produces a second tier of dv's.

Now the problem I am having is one cell in particular has over 9 entires and
Excel will only allow me to input 7 IF statements (I have looked at the
Contextures site and tried using their alternatives/suggestions to no avail
however the IF statements have worked with smaller entries elsewhere).

So I was thinking, could I not write the IF statement in VB and get the cell
(say A1) to run it after its updated (which will then use the correct dv for
cell A2 depending on A1'a value). How would I get the cell to call the
fucntion (if possible) please?

Kind regards,
Mav