Hi,
I am creating a new file from a list of rows which have columns A to U populated. The list has an Auto filter. This is then copied to a new file and the user has the option to save the file. The file name is prepopulated based on a variable and the current date using the following.
However, I would like to incorporate the Autofilter selection criteria in the file name. I have identified that the code for the autofilter selection criteria is
What I want to do is as follows:-
If Col A Criteria is "All" then goto Next Col until blank col is reached
If Col A Criteria is not "All" then concatenate it into a variable for use in the file name and then goto Next Col until blank col is reached.
Final result would be a file name of (using the above criteria as an example)
Essbase High 30 June 2004.xls
Many Thanks
Tiglet![[reading] [reading] [reading]](/data/assets/smilies/reading.gif)
Living on Earth is expensive, but it does include a free trip around the sun every year
I am creating a new file from a list of rows which have columns A to U populated. The list has an Auto filter. This is then copied to a new file and the user has the option to save the file. The file name is prepopulated based on a variable and the current date using the following.
Code:
Application.Dialogs(xlDialogSaveAs).Show (TabName & FormatDateTime(Date, vbLongDate) & ".xls")
However, I would like to incorporate the Autofilter selection criteria in the file name. I have identified that the code for the autofilter selection criteria is
Code:
Selection.AutoFilter Field:=2, Criteria1:="Essbase"
Selection.AutoFilter Field:=6, Criteria1:="High"
If Col A Criteria is "All" then goto Next Col until blank col is reached
If Col A Criteria is not "All" then concatenate it into a variable for use in the file name and then goto Next Col until blank col is reached.
Final result would be a file name of (using the above criteria as an example)
Essbase High 30 June 2004.xls
Many Thanks
Tiglet
![[reading] [reading] [reading]](/data/assets/smilies/reading.gif)
Living on Earth is expensive, but it does include a free trip around the sun every year