Ask a question
Dim col As String, cfind As Range
col = "sku"
Set cfind = Cells.Find(what:=col, lookat:=xlWhole)
ActiveSheet.Cells.Sort key1:=cfind, Header:=xlYes
I want to use the code below to sort my columns by searching for columns header first
Dim acell As Range
Set acell = Rows(2).Find(What:="sku", LookIn:=xlValues, LookAt:=xlWhole)
ActiveSheet.Range("A2").Sort acell.Offset(1), 2, Header:=xlYes
The Best of CCM in Your Inbox
The information gathered is for Communitic International to ensure the sending of the newsletter.
The information will be used subject to terms and conditions, for advertising purposes.
You reserve the right to access and change your personal data, aswell as the right to request its deletion within the limits permitted by law.