H
Howard
Correct! This gives the user easy access for editing. This can be a
hidden column that requires dialog access (InputBox perhaps).
Otherwise, if you want to restrict editing or keep the sheet 'clean'
then use a defined name, which optionally can be edited via a dialog.
You could even precede the sorting with a userform that informs the
user that cols need sorting, displaying a list of col labels and their
sort order. The MsgBox can ask if the sort is to be done with current
settings or solicit new settings. If new settings are entered then
update the named range (or defined name's RefersTo) before calling
SortCols().
Just some food for thought if you want to make the project a bit more
robust!
--
Garry
Free uenet access at http://www.eternal-september.org
Classic VB Users Regroup
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
One hurdle to overcome before I play with that last suggestion, which by the way seems pretty keen.
Got the cells named for four sheets, in the Name Manager looks like this:
Name SortCriteria
Value "e,f:g,h"
Refers To =Sheet2!$XFD$1
Scope Sheet2
(Other three are same-same relative to their sheet)
When I run the code (by selecting a sheet) I get a Compile Error
ByRef argument Type Mismatch.
The vSortCriteria (last word in this next line is blue highlighted) Which is the last line in the sheet activate code.
If Not vSortCriteria = "" Then Call SortCols(Sh, vSortCriteria)
Did I name the sheet cell incorrectly or is this something else?
Howard