I have tried to search for an answer, and have tried various VBA available. Unfortunately none seemed to work.
What I am hoping to achieve is:
- Move (not copy) the current Excel workbook (this is the file I have opened and where the drop list is located) from its current folder to another folder
- The workbook will not change name
- Achieve this by using a drop list
For example: source folder = c:\test, destination folder = c:\dest\ and c:\other. If I select "dest" in the drop list, the file will move from c:\test\ to c:\dest. If I select "Other", it will move to c:\other\ (all folders will be pre-created)
Below is what I have so far, but it does not appear to work:
If Target.Column = 5 And Target.Row = 8 Then
If Target.Value = "Dest" Then
Dim sFileNameExt As String
Dim sFilePath As String
Dim sNewPath As String
sNewPath = "c:\Dest\"
sFilePath = ActiveWorkbook.Path
sFileNameExt = ActiveWorkbook.Name
ActiveWorkbook.SaveAs sNewPath & sFileNameExt
Kill sFilePath & "\" & sFileNameExt
ElseIf Target.Value = "Other" Then
sNewPath = "c:\Other\"
sFilePath = ActiveWorkbook.Path
sFileNameExt = ActiveWorkbook.Name
ActiveWorkbook.SaveAs sNewPath & sFileNameExt
Kill sFilePath & "\" & sFileNameExt
End If
End If
Any help will be very much appreciated (oh if it is not obvious, I am extremely new to VBA...)