trecib=(val(sys(11,tablest.freciborep))-val(sys(11,tablest.fech_fin))) XLSheet.Cells(i+1,13).value = TRECIB fec1=val(sys(11,tablest.fech_fin)) fec2=val(sys(11,tablest.freciborep)) contador=0 do while fec1<>fec2 if dow(sys(10,(fec1))=1 or dow(sys(10,fec1))=7 contador=contador+1 endif fec1=fec1+1 enddo