954,228 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Excel Macro using vba :(

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

Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 
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:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 19/8/2004 by Mark Nemtsas
'

'
    Columns("A:D").Select
    Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
        OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
mnemtsas
Posting Whiz in Training
200 posts since Jul 2004
Reputation Points: 16
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You