Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Web Technology Web Design Tools Photoshop,Dreamweaver,Flash,Etc.Tutorials , References , Examples.

Web Technology Thread, object require?macros visual basic in Programming , WebDesign & Development; i wanna sort ascending and descending.i have done the if...........then.the problem is when i wanna run the if..........then the error ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=25867


Reply
LinkBack Thread Tools Display Modes
object require?macros visual basic
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
06-02-2009, 05:51 AM
 
i wanna sort ascending and descending.i have done the if...........then.the problem is when i wanna run the if..........then the error pops up object require,run time error 424.members can help me to check wat's wrong wit it?ty Code: ---------...

i wanna sort ascending and descending.i have done the if...........then.the problem is when i wanna run the if..........then the error pops up object require,run time error 424.members can help me to check wat's wrong wit it?ty

Code:
Sub sort()
Dim sort As Variant

sort = InputBox("To sort the driver code ascending", "sort", "descending")


' sort Macro
'
' Keyboard Shortcut: Ctrl+s
'

If ascending.sort = vbTrue Then

Range("D918").Select
ActiveWorkbook.Worksheets("Sheet1").sort.SortField s.Clear
ActiveWorkbook.Worksheets("Sheet1").sort.SortField s.Add Key:=Range("D9"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").sort
.SetRange Range("D918")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Else

End If



If descending.sort = vbTrue Then

Range("D918").Select
ActiveWorkbook.Worksheets("Sheet1").sort.SortField s.Clear
ActiveWorkbook.Worksheets("Sheet1").sort.SortField s.Add Key:=Range("D9"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").sort
.SetRange Range("D918")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

End If

End Sub
 
 
 
Reply

Web Technology Thread, object require?macros visual basic in Programming , WebDesign & Development; i wanna sort ascending and descending.i have done the if...........then.the problem is when i wanna run the if..........then the error ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=25867


Bookmarks

Tags
basic, object, requiremacros, visual


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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