+ Reply to Thread
Results 1 to 8 of 8

Hiding Rows, referencing a Linked Cell From A Combo Box

Hybrid View

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    Santa Clara, CA
    MS-Off Ver
    Excel 2003
    Posts
    21

    Hiding Rows, referencing a Linked Cell From A Combo Box

    Hey All, I need Help With This Problem
    I have A combo Box that Has A Selection, 1-5
    If selection "1" has been selected in the combo Box, I need Rows 14-29 Hidden
    If selection "2" has been selected in the combo Box, I need Rows 18-29 Hidden
    If selection "3" has been selected in the combo Box, I need Rows 22-29 Hidden
    If selection "4" has been selected in the combo Box, I need Rows 26-29 Hidden

    I will post the example tooExample.xls

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hiding Rows, referencing a Linked Cell From A Combo Box

    Hi cadk73,

    Your example doesn't include the dropdown code.

    Sub Dropdown1_Change(DDChoice As Integer)
    
    With ActiveSheet
    
    Select Case DDChoice
    Case 1
    .Rows("14:29").Hidden = True
    
    Case 2
    .Rows("14:17").Hidden = False
    .Rows("18:29").Hidden = True
    
    Case 3
    .Rows("14:21").Hidden = False
    .Rows("22:29").Hidden = True
    
    Case 4
    .Rows("14:25").Hidden = False
    .Rows("26:29").Hidden = True
    
    Case 5
    .Rows("14:29").Hidden = False
    End Select
    End With
    End Sub
    
    Sub TestDDC()
    Dropdown1_Change (5)
    
    End Sub

    But this code, properly placed, seems to do the trick.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    02-14-2012
    Location
    Santa Clara, CA
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hiding Rows, referencing a Linked Cell From A Combo Box

    Very, Very new at this,


    getting "Argument not optional"

  4. #4
    Registered User
    Join Date
    02-14-2012
    Location
    Santa Clara, CA
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hiding Rows, referencing a Linked Cell From A Combo Box

    And I'm not sure what the dropdown code is?

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hiding Rows, referencing a Linked Cell From A Combo Box

    Hi cadk73,

    Where is your code? The argument not optional means that the macro has to be called like:

    Dropdown1_Change(1 thru 5 here - this is the argument)

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hiding Rows, referencing a Linked Cell From A Combo Box

    Hi cadk73,

    Here's a copy of your book with the code which seems to be working!

    Copy of Example.xlsm

    I had all but forgotten how to code the standard controls, disregard most of my earlier comments - sorry!
    Last edited by xladept; 06-12-2012 at 07:50 PM. Reason: revise apology

  7. #7
    Registered User
    Join Date
    02-14-2012
    Location
    Santa Clara, CA
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Hiding Rows, referencing a Linked Cell From A Combo Box

    Thak you, It fixed it!!!

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hiding Rows, referencing a Linked Cell From A Combo Box

    Great - Glad it worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1