LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 277
Default List sorting and macros

Hey guys n gals,

Happy New Year!

I am creating a macro to alphabetize a list of names that will slowly
increase in length over time.

I know where the first cell in the list is, but I do not know where the
end is.

I use a named range to print my report references.

Ocaissonally I add a name and want to use this macro to sort the list.

My problem is that I always will want to select all the non-empty cells
within that named range.

I know there is a string which takes me to the last filled cell in a
column, but I cannot remember it.

So, I want my script to select the entire filled data set within named
range.

This is my current recording, which selects directly, without the named
range (which always starts at C18. So the script I need could ignore the
named range, and simply step down to the last filled cell.

My desire is to highlight that list, before the A to Z sort. The list
is always alpha and zero numerics.

Unless there is some shorter script for selecting and sorting a single
column list which also includes header fields, etc. This is why I
thought that a named range would work.

But I also have blank cell in that range which makes for blank lines in
the report so that they can be hand filled (it is a daily test data log)

Sub AlphaTize()
'
' AlphaTize Macro
'
' Alphabetize the long name listing
'
Range("C18:C80").Select
Range("C80").Activate
ActiveWorkbook.Worksheets("Info_Page").Sort.SortFi elds.Clear
ActiveWorkbook.Worksheets("Info_Page").Sort.SortFi elds.Add
Key:=Range("C80") _
, SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Info_Page").Sort
.SetRange Range("C19:C80")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
 
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
Drop down list using macros in a personal macros workbook jlcoop01 Excel Programming 0 October 23rd 09 03:56 PM
Sorting w/Macros cubbybear3 Excel Programming 1 February 14th 07 02:21 AM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 09:02 AM
Macros not appearing in the Tools Macro Macros list hglamy[_2_] Excel Programming 5 October 24th 03 09:10 AM
List the Macros that can be executed from Tools-Macros Rob Bovey Excel Programming 1 July 10th 03 05:34 PM


All times are GMT +1. The time now is 06:21 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"