LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Hide Rows based on Combobox Selection

I have a spreadsheet that I am automating. I have 15 lines with 15 comboboxes
each are labeled uniquely and based on the selection I need it to hide rows
on multiple sheets.

Here is what I have for one combobox, they are all very similar:

Private Sub ComboBox2XR_Change()
Dim c As String
Dim d As String


c = _
Worksheets("ReportRequestXR").Cells.Find(What:="Ac tXR2" & i &
"_BEGIN", after:=Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Row
d = _
Worksheets("ReportRequestXR").Cells.Find(What:="AC TXR2" & i &
"_END", after:=Range("A1"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Row

If ComboBox2XR.Value = "" Then
ComboBox2XR.Enabled = True
ComboBox2XR.Visible = True

End If

If ComboBox2XR.Value = "Encounter-Level" Then
ComboBox2XR.Enabled = True
Worksheets("ReportRequestXR").Rows(c & ":" & d).Hidden = xlVeryHidden

ElseIf ComboBox2XR.Value = "Accession-Level" Then
ComboBox2XR.Enabled = True
Worksheets("ReportRequestXR").Rows(c & ":" & d).Visible = True

End If

End Sub

The rows are not hiding as planned, any ideas?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call a UserForm based on ComboBox selection DJ Excel Programming 4 July 10th 08 11:38 PM
Populate Sheet based on ComboBox selection Steve[_4_] Excel Programming 4 March 5th 08 02:11 AM
How to populate a combobox based on selection from another combobo LinnT Excel Programming 6 November 23rd 07 09:23 AM
VB Script based on combobox selection gmac[_2_] Excel Programming 1 March 30th 07 07:34 PM
Hide Rows based on Time Selection in timesheet. thom hoyle Excel Programming 7 May 2nd 05 10:19 PM


All times are GMT +1. The time now is 06:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"