I have a template worksheet where the user enters data in three cells which are also named Ranges.
I have a button on the sheet which should save the file with the first two letters of the first Range, a space, the second Range, a space, and the third Range.
The file name should look something like In Test 29-Feb-08.xls.
The code I have works without the first two letters of the first Range.
Private Sub SaveFile_Click()
'
' SaveFile Macro
'
Dim Dt As Date
Dim Ex As String
Dt = Range("StartDate").Value
Ex = Left("ExIncOp", 2)
If IsEmpty(Worksheets("Operation").Range("ExIncOp")) Then
Msg = MsgBox("Please enter TYPE in cell C6 to continue ", vbOKOnly)
End If
If IsEmpty(Worksheets("Operation").Range("Name")) Then
Msg = MsgBox("Please enter NAME in cell H6 to continue ", vbOKOnly)
End If
If IsEmpty(Worksheets("Operation").Range("StartDate")) Then
Msg = MsgBox("Please enter DATE FROM in cell E10 to continue", vbOKOnly)
Exit Sub
End If
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & Range _
("Debrief_Folder").Value & "\" & Range("Name"). _
Value & " " & Format(Dt, "dd-mm-yy") & ".xls", FileFormat:=xlNormal
End Sub
I would like to add those two letters to the file name by replacing the red code with something like
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & Range _
("Debrief_Folder").Value & "\" & Range("Ex").Value & " " & Range("Name"). _
Value & " " & Format(Dt, "dd-mm-yy") & ".xls", FileFormat:=xlNormal
The magenta code is my addition, which does not work 
Can anyone see the error?
Thanks in advance
Bookmarks