ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,251
- Office Version
- 2007
- Platform
- Windows
Hi,
I am using the code shown below.
It sorts column A fine so now i wish to use the same code for columns BCD
I change the range code to match each column but when i run the code it allgoes out of sync but dont know why.
Basically i have a userform with 4 command buttons for each column.
When i use the command button for the column in question i wish to just sort A-Z
I am using the code shown below.
It sorts column A fine so now i wish to use the same code for columns BCD
I change the range code to match each column but when i run the code it allgoes out of sync but dont know why.
Basically i have a userform with 4 command buttons for each column.
When i use the command button for the column in question i wish to just sort A-Z
Rich (BB code):
Private Sub CarBikeSort_Click()
Dim X As Long
Application.ScreenUpdating = False
With Sheets("KEYCODES")
If .AutoFilterMode Then .AutoFilterMode = False
X = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("A2:Z" & X).Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess
End With
ActiveWorkbook.Save
Application.ScreenUpdating = True
Unload SortForm
End Sub