|
select column A and B but not row 1
Please Register to Remove these Ads
sorry for this stupid question...
i am trying to select column A and column B and apply a filter. however, I don't want the filter to be applied to row 1...
so i tried adding
Code:
Selection.Offset(1, 0)
somewhere in the following code but i couldn't get it to work...
Code:
Sub Macro8()
'
' Macro8 Macro
'
'
Columns("A:B").Select
ActiveWorkbook.Worksheets("sort").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("sort").Sort.SortFields.Add Key:=Range("A1:A351"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("sort").Sort
.SetRange Range("A1:B351")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
please share your insights
Last edited by hluk; 07-03-2009 at 12:02 AM.
|