My Combobox lists the customers that are shown in column G (see pics below). Based on the value that is selected, all the rows except those listing that customer(value) are hidden.
So... it all works fine, *but* I cant figure out how when the first choice of "Show all Customers" is selected that ALL the rows be shown (unhidden)
my code:
my spreadsheet (for visual explanation)
spreadsheet before making a selection (showing all rows):
spreadsheet after making a selection:
currently when choosing "show all customers" (I need this so when the selection "show all customers" is chosen ALL rows are shown.)
So... it all works fine, *but* I cant figure out how when the first choice of "Show all Customers" is selected that ALL the rows be shown (unhidden)
my code:
Code:
WORKBOOK CODE:
Sub Workbook_Open()
Worksheets("Seatex Incident Log").Activate
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = False
ActiveWindow.ScrollColumn = 1
With Rows("10:356")
.Hidden = False
End With
With Sheets("Seatex Incident Log").ComboBox1
.AddItem "Show all Customers"
.AddItem "Internal Seatex Incident"
.AddItem "AEGIS"
.AddItem "A.I.M.P"
.AddItem "A-1 CHEMICAL EQUIP. & SUPPL"
.AddItem "ACP"
(this continues for another 300+ customers)
.Value = "Show all Customers"
End With
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
Private Sub Workbook_Close()
SHEET1 CODE:
Private Sub ComboBox1_Change()
Application.Calculation = xlAutomatic
Application.ScreenUpdating = False
ActiveWindow.ScrollColumn = 1
Dim DataCriteria As String
Dim rCol As Long
rCol = ActiveSheet.UsedRange.Rows.Count
For Each Cell In Range(Cells(10, 7), Cells(rCol, 7))
DataCriteria = ComboBox1.Value
If Cell = DataCriteria Then Rows(Cell.Row).Hidden = False Else Rows(Cell.Row).Hidden = True
Next
Application.Calculation = xlAutomatic
Application.ScreenUpdating = False
End Sub
Application.DisplayFullScreen = False
ActiveWindow.DisplayHeadings = True
With Rows("10:356")
.Hidden = False
End With
End Sub
my spreadsheet (for visual explanation)
spreadsheet before making a selection (showing all rows):
spreadsheet after making a selection:
currently when choosing "show all customers" (I need this so when the selection "show all customers" is chosen ALL rows are shown.)