D
Dave Peterson
dim testwks as worksheet
dim WksName as string
wksname = format(dateserial(2009,12,25), "yyyymmdd")
set testwks = nothing
on error resume next
set testwks = worksheets(wksname)
on error resume next
if testwks is nothing then
'doesn't exist, so create it
set testwks = worksheets.add
testwks.name = wksname
end if
with testwks 'either the existing one or the one created.
.range("A1").value = "hi there"
end with
(Untested, uncompiled. Watch for typos.)
dim WksName as string
wksname = format(dateserial(2009,12,25), "yyyymmdd")
set testwks = nothing
on error resume next
set testwks = worksheets(wksname)
on error resume next
if testwks is nothing then
'doesn't exist, so create it
set testwks = worksheets.add
testwks.name = wksname
end if
with testwks 'either the existing one or the one created.
.range("A1").value = "hi there"
end with
(Untested, uncompiled. Watch for typos.)