View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sdg8481 sdg8481 is offline
external usenet poster
 
Posts: 29
Default VBA Coding Error

just Hi,

I have the following code in VBA which should hopeful should add 13 working
days to a date entered into a form text box (Referral_Box). However, i can't
get it working as its just returning FALSE, any ideas what wrong thanks.

Dim S As String
S = Referral_Box.Text
InBy_Box.Text = S = S & "+IF(13=0,0,SIGN(13)*SMALL(IF((WEEKDAY(" & S &
"+SIGN(13)*(ROW(INDIRECT(""1:""&ABS(13)*10))),2)<6 )*ISNA(MATCH(" & S &
"+SIGN(13)*(ROW(INDIRECT(""1:""&ABS(13)*10))), 25/12/06,0)),ROW(INDIRECT(""1:""&ABS(13)*10))),ABS(13))) "
Debug.Print Evaluate(S)

Whereby, InBy_Box is where i want 13 days (excluding holidays) to be added
to the date put in the Referral_Box field.

Thanks