943,648 Members | Top Members by Rank

Ad:
Aug 18th, 2004
0

Excel Macro using vba :(

Expand Post »
hey guys... I want to be able to auto sort rows ascending in a worksheet according to the first column... I want to make a visual basic macro for this... any ideas?

Thanks in advance
Similar Threads
Reputation Points: 115
Solved Threads: 7
Practically a Master Poster
Slade is offline Offline
633 posts
since Mar 2004
Aug 19th, 2004
0

Re: Excel Macro using vba :(

Quote originally posted by slade ...
hey guys... I want to be able to auto sort rows ascending in a worksheet according to the first column... I want to make a visual basic macro for this... any ideas?

Thanks in advance
Try recording the macro, that's how I taught myself VB to begin with. here's the code from me recording a sort:

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Sub Macro1()
  2. '
  3. ' Macro1 Macro
  4. ' Macro recorded 19/8/2004 by Mark Nemtsas
  5. '
  6.  
  7. '
  8. Columns("A:D").Select
  9. Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
  10. OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
  11. End Sub
Reputation Points: 16
Solved Threads: 1
Posting Whiz in Training
mnemtsas is offline Offline
200 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: FIeld width zero?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Datashet View





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC