referring to selection from multi-select userform
Hi,
I have a multiselect userform whereby the user chooses values that are sourced from a headings on a worksheet. The values that are chosen I would like to show, but the values that aren't I would like to hide the entire column. I'm really not enjoying vba at the mom. Here is the code which i keep getting 'object required' Private Sub CommandButton1_Click() 'This is the code linked to the 'ok' button on the multiselect userform Rng = Sheets("BS Method").Range("Filter_Entname").Columns.Count - 2 RngCellValue = Sheets("BS Method").Range("Filter_Entname") StartCell = Sheets("BS Method").Range("E9") Application.ScreenUpdating = False For i = 1 To Rng If StartCell.Value < ListBox1.Selection Then Selection.EntireColumn.Hidden = True Else StartCell.Offset(0, 1).Select End If Next i Application.ScreenUpdating = True End Sub Sorry for posting such 'beginner' questions Thanks |
All times are GMT +1. The time now is 02:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com