PIsabel
Board Regular
- Joined
- Feb 4, 2014
- Messages
- 126
- Office Version
- 365
- Platform
- Windows
I have this code that with the open file renames the file then changes the folder and deletes the original file and it works fine.
Now I need the code to run differently depending on the location of the file.
For now I have this code but it is not working and I am not making it work
Someone help me?
Now I need the code to run differently depending on the location of the file.
For now I have this code but it is not working and I am not making it work
Someone help me?
Code:
Sub change_location()
Dim strWbKill As String
Dim wSheet As Worksheet
Sheets("Orçamento").Select
If ThisWorkbook.Path = "\\Servidor\servidor\ORÇAMENTOS\orç - A Fazer" Then
With ThisWorkbook
strWbKill = .FullName
.SaveAs "\\Servidor\servidor\ORÇAMENTOS\orç - A Fazer\" & "Feito"
End With
Kill strWbKill
End If
Sheets("Orçamento").Select
If ThisWorkbook.Path = "\\Servidor\servidor\ORÇAMENTOS\orç - Vendido" Then
With ThisWorkbook
strWbKill = .FullName
.SaveAs "\\Servidor\servidor\ORÇAMENTOS\orç - Vendido\" & "Vendido"
End With
Kill strWbKill
End If
End Sub