Hi.
I have a Training database to record what training people have received.
I have all employees on one sheet then have a user form with option to select a work line, this then hides all columns and row that are not associated with those areas.
Private Sub OptionButton2_Click()
Range("A8:A250").Select
Selection.EntireRow.Hidden = False
Range("A8:A19,A37:A250").Select
Selection.EntireRow.Hidden = True
Range("A9").Select
BeginColumn = 9
EndColumn = 160
ChkRow = 4
For ColCnt = BeginColumn To EndColumn
If Cells(ChkRow, ColCnt).Value = "SAJ" Then
Cells(ChkRow, ColCnt).EntireColumn.Hidden = False
Else
Cells(ChkRow, ColCnt).EntireColumn.Hidden = True
End If
Next ColCnt
UserForm1.Hide
End Sub
This works perfectly.
I want to insert another user form to run a filter on top of the original one that will hide columns based on Job role or primary area of work.
This is the code i have:
Private Sub OptionButton1_Click()
BeginColumn = 9
EndColumn = 16
ChkRow = 5
For ColCnt = BeginColumn To EndColumn
If Cells(ChkRow, ColCnt).Value = "MT" Then
Cells(ChkRow, ColCnt).EntireColumn.Hidden = False
Else
Cells(ChkRow, ColCnt).EntireColumn.Hidden = True
End If
Next ColCnt
UserForm3.Hide
End Sub
This works in that it hides columns based on the job role in row 5 but it unhides the ones that the original filter had hidden.
I need help in setting the range for the second so it only applies it to visible columns, i have tried various versions of offset or specialcellvisible codes but can't get it to work.
Anyone got any ideas on this? Your help would be greatly appreciated.
Ireland316
Bookmarks