ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,953
- Office Version
- 2007
- Platform
- Windows
The code in use is supplied below.
The problem i see now & then is column L is out of sync.
Column K in various cells have a colour written in text example BLACK
Column L matches it, So if K30 is BLUE then L30 should also be BLUE
Sometimes when i use this sheet i notice a cell in column L is empty but the cell in column K has say CLEAR in it ????
So info for you.
Headers in row 6
Row 7 is hidden
Range is A6-L6 then down the page
Do you see an issue in the code below please
The problem i see now & then is column L is out of sync.
Column K in various cells have a colour written in text example BLACK
Column L matches it, So if K30 is BLUE then L30 should also be BLUE
Sometimes when i use this sheet i notice a cell in column L is empty but the cell in column K has say CLEAR in it ????
So info for you.
Headers in row 6
Row 7 is hidden
Range is A6-L6 then down the page
Do you see an issue in the code below please
VBA Code:
Private Sub PressToSort_Click()
Dim x As Long
Dim ws As Worksheet
Set ws = Sheets("MCLIST")
Dim SortColumn As String
Select Case ComboBox1
Case "CUSTOMER"
SortColumn = "A"
Case "FRAME NUMBER"
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"
SortColumn = "J"
Case "LEAD TYPE"
SortColumn = "K"
Case "CONNECTOR USED"
SortColumn = "L"
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:L" & x).Sort Key1:=.Cells(2, SortColumn), Order1:=xlAscending, Header:=xlGuess
Range("A6").Select
Range("A8").Select
End With
End If
Unload AtoZMotorcycles
End Sub