Creating a dynamic Worksheet name?
Variables available in a worksheet:
LEFT(ProgramDataInput!H3,3) returns a 3 char name (or PHX)
ProgramDataInput!F3 hold a date in the format mm/dd/yyyy (or
09/21/05)
In the code below, instead of a fixed "NewWS" name, I'd like to create it
with a name the worksheet "mm-dd-yy rrr"
Example would be "09-21-05 PHX"
How do do the same "LEFT(ProgramDataInput!H3,3)" in a macro and how would I
substring out "09-21" out of "09/21/05" to use below?
If Target.Address = "$A$1" Then
Dim NewNewWS As Worksheet
Set NewNewWS = Worksheets.Add
With NewNewWS
.Name = "NewWS"
End With
End If
|