ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,226
- Office Version
- 2007
- Platform
- Windows
Hi,
I have a drop down list on my userform where ive just added a new column to sort.
This column being LEAD TYPE in column K
I have changed the rows from 8 to 11 so i dont have to scroll on the userform BUT i only see 10 options & not 11 ?
Looking at the code in use doesnt match what the userform drop down list shows ?
As you can see LEAD TYPE 1 reads LEAD where LEAD TYPE 2 isnt even shown at all.
I have a drop down list on my userform where ive just added a new column to sort.
This column being LEAD TYPE in column K
I have changed the rows from 8 to 11 so i dont have to scroll on the userform BUT i only see 10 options & not 11 ?
Looking at the code in use doesnt match what the userform drop down list shows ?
As you can see LEAD TYPE 1 reads LEAD where LEAD TYPE 2 isnt even shown at all.
VBA Code:
Private Sub CommandButton1_Click()
Dim x As Long
Dim ws As Worksheet
Set ws = Sheets("MC LIST")
Dim SortColumn As String
Select Case ComboBox1
Case "CUSTOMER"
SortColumn = "A"
Case "VIN"
SortColumn = "B"
Case "MAKE"
SortColumn = "C"
Case "MODEL"
SortColumn = "D"
Case "ITEM BOUGHT"
SortColumn = "E"
Case "CHIP"
SortColumn = "F"
Case "COUNTRY"
SortColumn = "G"
Case "ORIGINAL PN"
SortColumn = "H"
Case "YEAR"
SortColumn = "I"
Case "LEAD TYPE 1"
SortColumn = "J"
Case "LEAD TYPE 2"
SortColumn = "K"
End Select
If Len(SortColumn) <> 0 Then
Application.ScreenUpdating = False
With ws
If .AutoFilterMode Then .AutoFilterMode = False
x = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range("A7:K" & x).Sort Key1:=.Cells(2, SortColumn), Order1:=xlAscending, Header:=xlGuess
End With
End If
Unload AtoZMcList
End Sub