We use a formatter every day for a set of our files. The file naming convention used to be "XX000". Now, the files are named like this: "XX000-YYYY-MM-DD". I want to be able to add a date function to the VBA code so users can still enter the basic XX000 name into the InputBox and the current date will be added (in the correct format) to the file name through the macro. This will save users the time of having to input the date individually for the 20+ files they run through this formatter each day. (It's very redundant!)
I added the LDate variable, then syntax to try to add the date to the returned value Text.
Sub Quick_Format()
'
' Quick_Format Macro
'
Dim LDate As String
LDate = Format(Date, "yyyy-mm-dd")
'
Text = InputBox("Enter Item Code")
Range("A1") = Text
Windows(("" & Text) & "-")("" & LDate)("" & ".xls").Activate
Sheets("Home").Select
It's not happening! I get an error and when I click debug, the Windows line above is in red. I know I've made a syntax error, but all my attempts to correct it have failed.