Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheet
I want to name a worksheet. I want the name to be the current date. If there
already exists a worksheet with that name I want to add time to the name. The problem is that I do not know how to add time to the name of the worksheet. pls help me! any help appreciated! i = Worksheets.Count Worksheets.Add Count:=1, After:=Sheets(i) For j = 1 To i If Sheets(j).Name = Date Then blnTodaySheet = True End If Next If blnTodaySheet = True Then Sheets(i + 1).Name = Date + Time Else Sheets(i + 1).Name = Date & ":" & Time End If |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Naming worksheet
Hi Anne,
Try: '============= Public Sub Tester() Dim i As Long i = Worksheets.Count Worksheets.Add After:=Sheets(i) On Error Resume Next ActiveSheet.Name = Format(Date, "dd-mm-yy") If Err.Number < 0 Then ActiveSheet.Name = Format(Now, "dd-mm-yy hh mm") End If On Error GoTo 0 End Sub '<<============= --- Regards, Norman "Arne Hegefors" wrote in message ... I want to name a worksheet. I want the name to be the current date. If there already exists a worksheet with that name I want to add time to the name. The problem is that I do not know how to add time to the name of the worksheet. pls help me! any help appreciated! i = Worksheets.Count Worksheets.Add Count:=1, After:=Sheets(i) For j = 1 To i If Sheets(j).Name = Date Then blnTodaySheet = True End If Next If blnTodaySheet = True Then Sheets(i + 1).Name = Date + Time Else Sheets(i + 1).Name = Date & ":" & Time End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
naming worksheet tabs | Excel Discussion (Misc queries) | |||
Worksheet naming | Excel Discussion (Misc queries) | |||
Naming Worksheet | New Users to Excel | |||
Naming a worksheet help? | Excel Worksheet Functions | |||
Creating & Naming a New Worksheet | Excel Programming |