private sub worksheet_change(byval tagret as excel.range)
static dont as boolean
if not dont then
if isnumeric(target.value) then
select case len(target.value)
case 8
dont=true
target.value=dateserial(cint(right$(target.value,4)), cint(mid$(target.value,3,2)), cint(left$(target.value,2)))
dont=false
case 6
dont=true
target.value=dateserial(cint(right$(target.value,2)), cint(mid$(target.value,3,2)), cint(left$(target.value,2)))
dont=false
end select
end if
end if
end sub
private sub worksheet_change(byval tagret as excel.range)
static dont as boolean
if not dont then
select case target.column
case 1,2,3
if isnumeric(target.value) then
select case len(target.value)
case 8
dont=true
target.value=dateserial(cint(right$(target.value,4)), cint(mid$(target.value,3,2)), cint(left$(target.value,2)))
dont=false
case 6
dont=true
target.value=dateserial(cint(right$(target.value,2)), cint(mid$(target.value,3,2)), cint(left$(target.value,2)))
dont=false
end select
end if
end select
end if
end sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 87