Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default option button dependant micro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Option dependant upon entry!! Baffled Excel Discussion (Misc queries) 2 September 29th 08 10:05 PM
How to assing micro to a command button Qazi Ahmad Excel Discussion (Misc queries) 1 April 9th 07 06:38 AM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM
Option button help justaguyfromky Excel Programming 1 September 5th 05 10:17 PM
Option button Jennifer Excel Programming 3 April 15th 05 10:28 PM


All times are GMT +1. The time now is 12:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"