Trevor3007
Well-known Member
- Joined
- Jan 26, 2017
- Messages
- 675
- Office Version
- 365
- Platform
- Windows
morning i currently use the code below, but i also want to include 'invoice-" & the text in "G1"
so the tab would read :-
invoice-(cell G1) WC & Format(Range("a10").Value, "dd-mm-yyyy")
many thanks in advance.
KR
Trevor3007additional
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Set Target = Range("a10")
If Target = "" Then Exit Sub
On Error GoTo Badname
ActiveSheet.Name = "Invoice WC" & Format(Range("a10").Value, "dd-mm-yyyy")
Exit Sub
Badname:
MsgBox "Please revise the entry in a10." & Chr(13) _
& "It appears to contain one or more " & Chr(13) _
& "illegal characters." & Chr(13)
Range("a10").Activate
ActiveWorkbook.SaveAs Filename:="C:\Users\work3\OneDrive\UXL\Timesheets" & Application.PathSeparator & ActiveWorkbook.Sheets(1).Name
End Sub
so the tab would read :-
invoice-(cell G1) WC & Format(Range("a10").Value, "dd-mm-yyyy")
many thanks in advance.
KR
Trevor3007additional