Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have pasted my final code below and it works BEAUTIFULLY! Thank you
very much for your help. Private Sub cmdOK_Click() 'Dealer name If optAsc.Value = True And optDealer.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If If optDes.Value = True And optDealer.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("A2"), Order1:=xlDescending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If 'Signature If optAsc.Value = True And optSig.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If If optDes.Value = True And optSig.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("B2"), Order1:=xlDescending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If 'PO If optAsc.Value = True And optPO.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("C2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If If optDes.Value = True And optPO.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("C2"), Order1:=xlDescending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If 'Invoice If optAsc.Value = True And optInv.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("D2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If If optDes.Value = True And optInv.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("D2"), Order1:=xlDescending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If 'Date If optAsc.Value = True And optDate.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("E2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If If optDes.Value = True And optDate.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("E2"), Order1:=xlDescending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If 'Due Date If optAsc.Value = True And optDue.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("F2"), Order1:=xlAscending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If If optDes.Value = True And optDue.Value = True Then Range("Database").Select Selection.Sort Key1:=Range("F2"), Order1:=xlDescending, Header:=xlYes, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Option dependant upon entry!! | Excel Discussion (Misc queries) | |||
How to assing micro to a command button | Excel Discussion (Misc queries) | |||
keep source formatting is not an option in paste option button | Excel Discussion (Misc queries) | |||
Option button help | Excel Programming | |||
Option button | Excel Programming |