I have an excel workbook where there is continuosly created new worksheets. Sometimes some of the worksheets has to be preserved and ideally deleted from the workbook. The worksheets also needs to be archived in specific folders on SharePoint.
Right now the following VBA does the trick. Nevertheless, it duplicates every cell from the workbook, which I must then relocate to the proper place.
Dim ws As Worksheet
Dim wsDash As Worksheet
Dim wbToSave As Workbook
Dim filePathToSave As String
Application.ScreenUpdating = False
Set wsDash = Worksheets("LAJ")
filePathToSave = "C:\Test\Example\"
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> wsDash.Name Then
.Value = .Value
Set wbToSave = ActiveWorkbook
Filename:=filePathToSave & wbToSave.Worksheets(1).Name & ".xlsx", _
Application.ScreenUpdating = True
If it is possible, I would like to be able to select the precise worksheets to be duplicated or relocated as well as the precise location to which all of the selected worksheets will be transported. Preferably in a dialogue box for user comfort.