Trevor3007
Well-known Member
- Joined
- Jan 26, 2017
- Messages
- 675
- Office Version
- 365
- Platform
- Windows
good day ,
I have the following code :-
the issue ATM , that it will not save to the specific folder, but I can 'manually' save it to.
would it be possible to include a Yes/No / Both so it saves the file as either 'xls' ( to "C:\Users\user\Desktop\testdata"") and as a xlsm ("C:\Users\user\Desktop\testdata\macro") or both to there retrospective folders?
include a Yes / No message asking 'do you want to attach and email the saved file using the your designated outlook template? ( located in "C:\Users\user\Desktop\testdata\mailtemplate')
many thank in advance to the very kind person(s) who takes up this challenge
I have the following code :-
VBA 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 = "testdeta 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\user\Desktop\testdata" & Application.PathSeparator & ActiveWorkbook.Sheets(1).Name
End Sub
Sub Invoice()
Dim Path1 As String
Dim Path2 As String
Dim Path3 As String
Dim Path4 As String
Dim myfilename As String
Path = "C:\Users\user\Desktop\testdata"
Path1 = Range("a1")
Path2 = Range("b1")
Path3 = Range("f1")
Path4 = Range("g1")
ActiveWorkbook.SaveAs Filename:=Path & Path1 & Path2 & Path3 & Path4 & ".xls", FileFormat:=xlNormal
End Sub
the issue ATM , that it will not save to the specific folder, but I can 'manually' save it to.
would it be possible to include a Yes/No / Both so it saves the file as either 'xls' ( to "C:\Users\user\Desktop\testdata"") and as a xlsm ("C:\Users\user\Desktop\testdata\macro") or both to there retrospective folders?
include a Yes / No message asking 'do you want to attach and email the saved file using the your designated outlook template? ( located in "C:\Users\user\Desktop\testdata\mailtemplate')
many thank in advance to the very kind person(s) who takes up this challenge