Hide Range of Cells

  • Thread starter Thread starter cmaraglio
  • Start date Start date
C

cmaraglio

I have a comobox with serveral items in it. When you select a certain
item in the Combobox it will go to that item in the sheet and highlight
the range of cells for that item. What I would like to do is have the
all other on the page hide, and just show the selected item. How would
i go about doing that?


Thanks
Rob
 
Rob

maybe you could work around this:

Sub test()
Dim RangeToHide As Range
Cells.EntireRow.Hidden = False
Select Case ActiveCell.Row
Case Is = 1: Set RangeToHide = Range("A2:A65536").EntireRow
Case Is = 65536: Set RangeToHide = Range("A1:A65535").EntireRow
Case Else: Set RangeToHide = Union( _
Range("A1:A" & ActiveCell.Row - 1), _
Range("A" & ActiveCell.Row + 1 & ":A65536")).EntireRow
End Select
RangeToHide.EntireRow.Hidden = True
End Sub

Regards

Trevor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top