multilple sheets using days of curr month!

E

eijaz

Dear all,

i hv few questions:
1) How to write a procedure to automatically create a no of sheets as the no
of days in a month with the sheet names as 01, 02, 03...31...etc

2) how to write a procedure which will automatically create a sheet each
day, by concatenating the current date & a text such as "Comments", for the
Sheetname.
e.g the Sheet names would be created as " Comments-10292003",
"Comments-10302003" etc for each current day....?

3) How to check whether a sheet has already been created & not create it by
the same name again, but just append data to it.
tried Worksheet.Add method, but it only adds addnl worksheets, not append to
existing one.....

4) Made a Data Entry Template for transport reimbursement (voucher), which
is shared over a network. Is it possible to generate a Random Aplhanumeric #
for every user who fills in his reimbursement details( the details will
automatically be stored on a seperate excel workbook with the unique
aplhanumeric no along with the date when it was filled.

Can anybody help? any help would be really appreciated.

Thank & best rgds,

Eijaz
 
T

Tom Ogilvy

eom = Day(DateSerial(year(date),Month(date)+1,0))
for i = 1 to eom
Worksheets.Add
Activesheet.Name = Format(i,"00")
Next

Dim sName as String, sh as Worksheet
Dim rng as Range
sName = "Comments-" & Format(Date,"mmddyyyy")
On Error Resume Next
Set sh = worksheets(sName)
On Error goto 0
if not sh is nothing then
set sh = Worksheets.Add
sh.name = sName
set rng = sh.Cells(1,1)
Else
set rng = sh.Cells(rows.count,1).End(xlup)(2)
End if

' now you can write to rng and beyond.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top