LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Ross
 
Posts: n/a
Default sorting using macro


I created a series of macros that sort my spreadsheet by a different column
heads as needed, and assigned them to buttons, so I can sort by those
column when I want to by just clicking. It works fine, until I go and do
something else in the sheet, like highlight a range of data for printing.
After that, the macro fails and when I click debug, Below is one of the
macros
that sorts the column headed by names (names is in A1)Any ideas what I can
do to fix this? Thanks in advance.
Ross



Sub sortnames()
'
' sortnames Macro
' Macro recorded 9/14/2005 by ross D
'

'
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub

When the macro failed, the entire macro starting with "Selection.Sort Key 1
.. . ." was highlighted
in yellow.


 
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
Sorting - Macro or worksheet function Danny Excel Worksheet Functions 1 August 2nd 05 09:17 PM
Sorting - Macro or worsheet function Danny Excel Worksheet Functions 0 August 2nd 05 09:02 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
macro for sorting cherrynich Excel Discussion (Misc queries) 1 December 30th 04 04:47 PM
Macro for sorting different rows ciscopena Excel Worksheet Functions 0 November 1st 04 11:04 PM


All times are GMT +1. The time now is 08:52 PM.

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"