AlexanderBB
Well-known Member
- Joined
- Jul 1, 2009
- Messages
- 1,835
- Office Version
- 2019
- 2016
- Platform
- Windows
Code:
Sub SortACol(strSheetName As String, strEnd As String, Column as string)
Dim strColumnRange As String
Dim rngCurrentCell As Range
Dim rngNextCell As Range
strColumnRange = "A1:O" & Trim(strEnd)
Worksheets(strSheetName).Range(strColumnRange).Sort _
Key1:=Worksheets(strSheetName).Range(column &"1"), Order1:=xlAscending
Set rngCurrentCell = Worksheets(strSheetName).Range(strColumnRange)
End Sub
Can I have details on what to change to make that Sort only the Column passed in ?
Do I need all the DIMs and strColumnRange, plus know the last row (strEnd) in advance ?
Last edited: