Sorting - VBA
- From: kirkm <removethiskirkm@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 06 Mar 2007 16:51:50 +1300
Hi,
I found the following via Google
--
Sub SortColumn(strSheetName As String, strColumnLetter As String)
Dim strColumnRange As String
Dim rngCurrentCell As Range
Dim rngNextCell As Range
strColumnRange = strColumnLetter & "1"
Worksheets(strSheetName).Range(strColumnRange).Sort _
Key1:=Worksheets(strSheetName).Range(strColumnRange)
Set rngCurrentCell =
Worksheets(strSheetName).Range(strColumnRange)
End Sub
--
This sorts a column perfectly.
But the problem is, I need to sort cells which contain first a word
then a number. This only sorts the word.
If I change that to two coluimns, can the above Sort routine
be changed so it sorts both?
Thanks - Kirk
.
- Follow-Ups:
- Re: Sorting - VBA
- From: Greg Glynn
- Re: Sorting - VBA
- Prev by Date: Couple of basic questions from a beginner:
- Next by Date: Re: Workbooks.Open
- Previous by thread: Couple of basic questions from a beginner:
- Next by thread: Re: Sorting - VBA
- Index(es):