Bad day. Using the information here: http://www.mrexcel.com/forum/excel-...pplications-make-sheet-name-=-cell-value.html
I had a macro doing what I wanted. Now it's not and for the life of me I can't see what I did that made it stop working. Not that I know much more than how to copy/paste & hack at code till it does what I want . . .
Error is on: ActiveSheet.Name = ActiveSheet.Range("A1")
A2 = 11/21/2016 8:25:43 AM
A1 is null
Result:
Run-time error '1004':
You typed an invalid name for a sheet or chart. Make sure that:
• The name that you type does not exceed 31 characters.
• The name does not contain any of the following characters: : \ / ? * [ or ]
• You did not leave the name blank.
TIA
Ron
I had a macro doing what I wanted. Now it's not and for the life of me I can't see what I did that made it stop working. Not that I know much more than how to copy/paste & hack at code till it does what I want . . .
Error is on: ActiveSheet.Name = ActiveSheet.Range("A1")
A2 = 11/21/2016 8:25:43 AM
A1 is null
Code:
Public Sub BINameSheet_t1()
' Formats cell A2 in the 5 line header as a short date.
' Cell A1 renders cell A2 as text.
' Names the worksheet the date of the report.
Range("A2").NumberFormat = "m-dd-yy"
Range("A1").FormulaR1C1 = "=TEXT(R[1]C,""m-dd-yy"")"
ActiveSheet.Name = ActiveSheet.Range("A1")
End Sub
Result:
Run-time error '1004':
You typed an invalid name for a sheet or chart. Make sure that:
• The name that you type does not exceed 31 characters.
• The name does not contain any of the following characters: : \ / ? * [ or ]
• You did not leave the name blank.
TIA
Ron