Hi
I
have looked through the forums and can find answers to part of my question but not in full and when I have tried to join the various elements together it wont work.
Effectively I want to do the following
Name the file using the naming convention set in cell B1 of the sheet named 'review form'
I then want this to create a pop up which will prompt the user to save the file at a location of their choosing
so effectively the automated part will select the file name and also save it as an xlsx rather than xlsm
I have tried combining the following but it just wont work.
a question I have is the workbook has several hidden sheets which I need to remain hidden or actually can be removed when saving if this is an option.
The sheet I need to use 'review form' has the file naming convention in cell B1, It is also a protected sheet with only certain cells editable so I am not sure whether this may affect anything? Finally there are formulas in this sheet that I will need to remain there once saved, again not sure this makes a difference.
Thank you
Sub SaveAs()
Dim SaveName As String
SaveName = ActiveSheet.Range("b2").Text
ActiveWorkbook.SaveAs Filename:="E:\User\JoeDoe" & _
SaveName & ".xls"
End Sub
Sub Macro2()
Dim flder As FileDialog
Dim foldername As String
Set flder = Application.FileDialog(msoFileDialogFolderPicker)
With flder
.Title = "Select the folder containing data"
.AllowMultiSelect = True
If .Show <> -1 Then GoTo NextCode
foldername = .SelectedItems(1)
End With
NextCode:
GetFolder = foldername
Set flder = Nothing
I
have looked through the forums and can find answers to part of my question but not in full and when I have tried to join the various elements together it wont work.
Effectively I want to do the following
Name the file using the naming convention set in cell B1 of the sheet named 'review form'
I then want this to create a pop up which will prompt the user to save the file at a location of their choosing
so effectively the automated part will select the file name and also save it as an xlsx rather than xlsm
I have tried combining the following but it just wont work.
a question I have is the workbook has several hidden sheets which I need to remain hidden or actually can be removed when saving if this is an option.
The sheet I need to use 'review form' has the file naming convention in cell B1, It is also a protected sheet with only certain cells editable so I am not sure whether this may affect anything? Finally there are formulas in this sheet that I will need to remain there once saved, again not sure this makes a difference.
Thank you
Sub SaveAs()
Dim SaveName As String
SaveName = ActiveSheet.Range("b2").Text
ActiveWorkbook.SaveAs Filename:="E:\User\JoeDoe" & _
SaveName & ".xls"
End Sub
Sub Macro2()
Dim flder As FileDialog
Dim foldername As String
Set flder = Application.FileDialog(msoFileDialogFolderPicker)
With flder
.Title = "Select the folder containing data"
.AllowMultiSelect = True
If .Show <> -1 Then GoTo NextCode
foldername = .SelectedItems(1)
End With
NextCode:
GetFolder = foldername
Set flder = Nothing