Thanks for your code. It works nicely. But I tried to incorporate it into my workbook, but in vain.
Actually what I want is:
A2:AP55 my data is there. In between ColT will accept only one value "YES". If the macro is executed, then it should find "YES" in colT and Clearcontents, AND THEN, it should sort the data by 2 levels (i.e. First by ColF and and then by ColE).
Your code is:
Sub test()
Dim oneCell As Range
With ThisWorkbook.Sheets("sheet1").Range("T:T")
For Each oneCell In Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
If oneCell.Value = "yes" Then
oneCell.EntireRow.SpecialCells(xlCellTypeConstants).ClearContents
End If
Next oneCell
End With
End Sub
My code to sort:
Range("B2").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Sort Key1:=Range("F2"), Order1:=xlAscending, Key2:=Range("E2"), _
Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("B3").Select
Can you please tell me where I am to modify? Or entirely the code should be modified?
Please Sir,
acsishere.
Bookmarks