Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In "D22" I have a formula "=H9+3". I want the calculated value of "D22" to
display as a date in the worksheet TAB. This code looks like it should work with a date, but doesn't ++++ Private Sub Workbook_SheetChange(ByVal Sh As Object, _ ByVal Target As Excel.Range) Dim wksh As Worksheet Dim sStr As String If Target.Address = "D22" Then If IsDate(Target) Then sStr = Format(Target.Value, "dd-mmm-yyyy") ' does the sheet already have that name If Sh.Name = sStr Then Exit Sub ' Does another sheet have that name On Error Resume Next Set wksh = Nothing Set wksh = Worksheets(sStr) On Error GoTo 0 If Not wksh Is Nothing Then MsgBox "There is already a sheet with the name " & sStr Exit Sub End If ' Everything OK, rename sheet Sh.Name = sStr End If End If End Sub ++++ Anyone out there have code that works with dates? Any help would be appreciated!! Kelvin |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I get a new calculated date from different date ranges? | Excel Worksheet Functions | |||
pivot with calculated date | Charts and Charting in Excel | |||
How can I match a calculated date to closest date from a list? | Excel Worksheet Functions | |||
Totals calculated by date | Excel Discussion (Misc queries) | |||
how to change a calculated cell to = the calculated value | Excel Discussion (Misc queries) |