RE: Combo Box

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks All- this is great

"Patrick Molloy" wrote:

> you're correct
> use
>
> dim colClient as long
> colClient = 7 ' 7=G
>
> Key1:=Cells(9,colClient)
>
> you could easily use say the MATCH() function to determine what column to use
> eg
> colClient = work***.functions.Match(what,Range("A9:L9"),False)
>
> HTH
> Patrick
>
> "teresa" wrote:
>
> > Sub SOR()
> > I have a combobox - when I choose an option it arranges data according to
> > Client which is currently in column G, however I need to sort data according
> > to "Client" irrespective of the Column, how do I tinker with the code below
> > to do this - Thanks
> >
> > The bit I think I need changing is Key1:=Range("G9")
> > to
> > Range("col("Client")9) or something like this
> >
> >
> > Range("C9:AS69").Select
> > Selection.Sort Key1:=Range("G9"), Order1:=xlAscending, Header:=xlGuess, _
> > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
> > End Sub
> >
> >
> >
> >
.


Quantcast