Hi there,
I currently have a worksheet labelled "Register".
I have this code whereby it extracts the worksheet and provides the 'save as' option to a folder.
The worksheet has headers and filters. The columns: O-U are labelled as follows:
Column O: Marston Green
Column P: Test Engineering
Column Q: West Hartford
Column R: Singapore
Column S: Xiamen
Column T: Neuss
Column U:Dubai
These columns are of True/False cells only.
What I also want to do for the current coding I have is two things:
1) When It runs, a message box appears stating which location would you like to extract out of the above & the option for criteria True or False.
2) When the Register worksheet is extracted, the new worksheet doesn't have the filters on anymore. So the new worksheet is essentially a print screen of what has been extracted from the Register worksheet.
Here is the current coding I have:
Thanks
I currently have a worksheet labelled "Register".
I have this code whereby it extracts the worksheet and provides the 'save as' option to a folder.
The worksheet has headers and filters. The columns: O-U are labelled as follows:
Column O: Marston Green
Column P: Test Engineering
Column Q: West Hartford
Column R: Singapore
Column S: Xiamen
Column T: Neuss
Column U:Dubai
These columns are of True/False cells only.
What I also want to do for the current coding I have is two things:
1) When It runs, a message box appears stating which location would you like to extract out of the above & the option for criteria True or False.
2) When the Register worksheet is extracted, the new worksheet doesn't have the filters on anymore. So the new worksheet is essentially a print screen of what has been extracted from the Register worksheet.
Here is the current coding I have:
Code:
Sub ExtractWorksheet()
If MsgBox("This will begin the process to extract the 'Register' worksheet. Proceed?", vbYesNo) = vbNo Then Exit Sub
Dim wb As Workbook, InitFileName As String, fileSaveName As String
InitFileName = ThisWorkbook.Path & "\ Extracted_Register_" & Format(Date, "dd-mm-yyyy")
Sheets("Register").Copy
' or below for more than one sheet
' Sheets(Array("Output", "Sheet2", "Sheet3")).Copy
Set wb = ActiveWorkbook
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=InitFileName, _
filefilter:="Excel files , *.xlsx")
With wb
If fileSaveName <> "False" Then
.SaveAs fileSaveName
.Close
Else
.Close False
Exit Sub
End If
End With
End Sub
Thanks