Excel - automatically hiding select rows based on drop down selection

%3CLINGO-SUB%20id%3D%22lingo-sub-187276%22%20slang%3D%22en-US%22%3EExcel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-187276%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3EHi%20there!%20I%20have%20a%20drop%20down%20selection%20of%2010%20items%20on%20my%20dashboard%20tab%20and%20am%20trying%20to%20only%20show%20rows%2057%20to%2072%20when%20I%20select%20one%20of%20them.%20I%20am%20using%20the%20following%20code%20but%20somehow%20it%20is%20not%20working%20and%20my%20dashboard%20does%20not%20change%20at%20all.%20However%2C%20when%20I%20key%20in%20something%20into%20a%20random%20cell%2C%20the%20page%20reloads%20and%20rows%2057%3A72%20become%20hidden.%20But%20then%2C%20it%20stays%20the%20same%20across%20all%20my%20selections%20and%20I%20cannot%20unhide%20it%20again%20through%20the%20drop%20box%20selection.%20May%20I%20know%20if%20anyone%20has%20an%20alternative%20suggestion%3F%20Thank%20you%20in%20advance!%3C%2FDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%3C%2FDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3EIf%20Target.Column%20%3D%202%20And%20Target.Row%20%3D%203%20And%20Target.Value%20%3D%20%221%22%3C%2FDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3EThen%20Application.Rows(%2257%3A72%22).Select%20Application.Selection.EntireRow.Hidden%20%3D%20False%3C%2FDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3EElse%20Application.Rows(%2257%3A72%22).Select%20Application.Selection.EntireRow.Hidden%20%3D%20True%3C%2FDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3EEnd%20If%3C%2FDIV%3E%3CDIV%20class%3D%22m_1018432915032829176quote%22%3EEnd%20Sub%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-187276%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20%26amp%3B%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENeed%20Help%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-187432%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-187432%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20provide%20me%20with%20screenshots%20of%20your%20dashboard%20to%20figure%20out%20what%20the%20problem%20is.%3C%2FP%3E%3CP%3EIt's%20best%20if%20you%20can%20attach%20the%20workbook.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-187416%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-187416%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20Haytham%2C%20unfortunately%20it%20seems%20like%20it%20is%20my%20excel%20sheet%20that%20is%20causing%20the%20problem.%20The%20same%20issue%20remains%20(that%20the%20bars%20don't%20get%20hidden%20until%20I%20type%20something%20into%20cell%20J3%2C%20after%20which%20it%20does%20not%20unhide%20again).%20I%20tried%20your%20method%20on%20a%20new%20excel%20file%20and%20it%20worked.%20If%20you%20happen%20to%20know%20how%20I%20can%20troubleshoot%20this%20issue%20please%20let%20me%20know.%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-187321%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-187321%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20understand%20you%20well%2C%20you%20want%20to%20show%20rows%2057%20to%2072%20when%20you%20select%20the%20value%20of%201%20from%20the%20dropdown%20list%2C%20otherwise%2C%20you%20want%20to%20hide%20them.%3CBR%20%2F%3EI%20think%20that%20the%20dropdown%20list%20in%20cell%20B3%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBased%20on%20that%2C%20please%20try%20this%20code%20instead%3A%3C%2FP%3E%3CPRE%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20If%20Range(%22B3%22)%20%3D%20%221%22%20Then%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2257%3A72%22).EntireRow.Hidden%20%3D%20False%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Else%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2257%3A72%22).EntireRow.Hidden%20%3D%20True%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20End%20If%3CBR%20%2F%3EEnd%20Sub%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1103333%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1103333%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20the%20info%20on%20how%20to%20use%20a%20macro%20to%20hide%20rows.%26nbsp%3B%20I%20have%20a%20question%20as%20an%20extension%20to%20the%20first%20question.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20see%20how%20you%20hide%20rows%20based%20on%20the%20content%20of%20a%20cell.%26nbsp%3B%20Is%20it%20also%20possible%20to%20use%20the%20same%20macro%20to%20set%20the%20print%20area%20of%20the%20document%20so%20that%20it%20prints%20the%20rows%20that%20are%20still%20active%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3Ewmsawchuk%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1103709%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1103709%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F514936%22%20target%3D%22_blank%22%3E%40wmsawchuk%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYes%2C%20that's%20possible!%3C%2FP%3E%3CP%3ETry%20this%20code%3A%3C%2FP%3E%3CPRE%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%3CBR%20%2F%3E%20%20If%20Range(%22B3%22)%20%3D%20%221%22%20Then%3CBR%20%2F%3E%20%20%20%20Rows(%2210%3A15%22).EntireRow.Hidden%20%3D%20False%3CBR%20%2F%3E%20%20%20%20ActiveSheet.PageSetup.PrintArea%20%3D%20%22%24A%241%3A%24H%2415%22%3CBR%20%2F%3E%20%20Else%3CBR%20%2F%3E%20%20%20%20Rows(%2210%3A15%22).EntireRow.Hidden%20%3D%20True%3CBR%20%2F%3E%20%20%20%20ActiveSheet.PageSetup.PrintArea%20%3D%20%22%24A%241%3A%24H%249%22%3CBR%20%2F%3E%20End%20If%3CBR%20%2F%3EEnd%20Sub%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1103830%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1103830%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20very%20much%20for%20the%20code%20to%20set%20the%20print%20area.%26nbsp%3B%20It%20works%20great%20and%20I%20really%20appreciate%20your%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1154050%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1154050%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F514936%22%20target%3D%22_blank%22%3E%40wmsawchuk%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20do%20you%20run%20the%20macro%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1519524%22%20slang%3D%22de-DE%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1519524%22%20slang%3D%22de-DE%22%3EMaybe%20the%20other%20way%20round...%20%3CBR%20%2F%3E%20ALT%20%2B%20F11%20and%20click%20on%20the%20desired%20picture%2C%20copy%20the%20code%20...%20change%20the%20lines%20as%20desired%20beforehand.%20%3CBR%20%2F%3E%3CBR%20%2F%3E%20Private%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%20%3CBR%20%2F%3E%20Dim%20Range%20As%20Range%2C%20Calculation%20As%20Long%20%3CBR%20%2F%3E%20Calculation%20%3D%20Application.Calculation%20%3CBR%20%2F%3E%20Application.Calculation%20%3D%20xlCalculationAutomatic%20%3CBR%20%2F%3E%20Application.ScreenUpdating%20%3D%20False%20%3CBR%20%2F%3E%20Me.Unprotect%20(%221234%22)%20%3CBR%20%2F%3E%20Set%20Range%20%3D%20Intersect(Target%2C%20Range(%22A15%3AA1009%22))%20%3CBR%20%2F%3E%20If%20Not%20Area%20Is%20Nothing%20Then%20%3CBR%20%2F%3E%20Application.EnableEvents%20%3D%20False%20%3CBR%20%2F%3E%20Range(%22A15%3AA1009%22).%20EntireRow.Hidden%20%3D%20False%20%3CBR%20%2F%3E%20Range(%22A10%3AA1000%22).%20EntireRow.AutoFit%20%3CBR%20%2F%3E%20Range(%22A%22%20%26amp%3B%2045%20%2B%20WorksheetFunction.Counta(%20_%20%3CBR%20%2F%3E%20Range(%22A15%3AA1009%22))%20%26amp%3B%20%22%3AA1009%22).%20EntireRow.Hidden%20%3D%20True%20%3CBR%20%2F%3E%20End%20If%20%3CBR%20%2F%3E%20Me.Protect%20(%221234%22)%20%3CBR%20%2F%3E%20Application.EnableEvents%20%3D%20True%20%3CBR%20%2F%3E%20Application.Calculation%20%3D%20Calculation%20%3CBR%20%2F%3E%20Application.ScreenUpdating%20%3D%20True%20%3CBR%20%2F%3E%20End%20Sub%20%3CBR%20%2F%3E%3CBR%20%2F%3E%20Regards%2C%20%3CBR%20%2F%3E%20Nikolino%20%3CBR%20%2F%3E%20(Knows%20I%20don't%20know%20anything)%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1519528%22%20slang%3D%22de-DE%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1519528%22%20slang%3D%22de-DE%22%3Edesired%20picture%20%3D%20disired%20sheet%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1846662%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1846662%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35679%22%20target%3D%22_blank%22%3E%40Haytham%20Amairah%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20looking%20to%20create%20a%20worksheet%20where%20a%20user%20is%20presented%20with%20different%20options%20(more%20than%202%20options)%20from%20a%20dropdown%20and%20based%20on%20their%20responses%20(i.e%20if%20user%20chooses%20any%20one%20of%202%20options%20-%20eg.%20choice%20A%20or%20choice%20B)%2C%20a%20new%20question%20appears%20on%20the%20Excelsheet%20in%20a%20row%20below%20the%20first%20question%2C%20otherwise%20they%20don't.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20then%20based%20on%20the%20users'%20response%20to%20this%20second%20question%20(posed%20as%20a%20dropdown%20choice)%2C%20a%20third%20question%20appears%20or%20does%20not%20appear.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20is%20obvious%2C%20I%20am%20seeking%20to%20have%20several%20nested%20questions%20within%20the%20Excelsheet%20where%20each%20subsequent%20question%20shows%20up%20as%20a%20Dropdown%20based%20on%20the%20user's%20response%20from%20a%20previous%20question%20(also%20a%20dropdown).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20able%20to%20create%20dropdowns%20for%20each%20question%20and%20create%20one%20of%20the%20questions%20to%20appear%20based%20on%20a%20prior%20question%2C%20but%20am%20having%20trouble%20going%20any%20further.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20much%20appreciated.%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1846683%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1846683%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F855146%22%20target%3D%22_blank%22%3E%40RishiSumit%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPerhaps%20you%20mean%20nested%20drop-down%20list.%20See%2C%20for%20example%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7mo4COng7Sg%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7mo4COng7Sg%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1846762%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1846762%22%20slang%3D%22en-US%22%3EThanks%20Sergei.%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20video%20shows%20how%20to%20draw%20data%20from%20a%20dropdown%20list%20that%20is%20visible%20on%20the%20Excel%20sheet%20regardless%20of%20the%20user's%20response.%3CBR%20%2F%3E%3CBR%20%2F%3EHowever%2C%20I%20am%20trying%20to%20make%20a%20sheet%20where%20a%20follow%20up%20question%20(%26amp%3B%20its%20associated%20dropdown%20list)%20does%20not%20become%20visible%20unless%20user%20chooses%20either%20say%20option%20C%20or%20D%20(out%20of%206%20options%20a%2Cb%2Cc%2Cd%2Ce%2Cf).%20Once%20user%20chooses%20option%20c%20or%20d%20--%26gt%3B%20then%20the%20next%20question%20(%26amp%3B%20its%20dropdown%20list)%20appears%20in%20the%20following%20row.%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%2C%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1887232%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1887232%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F855146%22%20target%3D%22_blank%22%3E%40RishiSumit%3C%2FA%3E%26nbsp%3BThis%20is%20exactly%20what%20I%20am%20trying%20to%20do.%26nbsp%3B%20Did%20you%20find%20a%20resolution%3F%20I%20originally%20created%20this%20structure%3A%3C%2FP%3E%3CP%3EPrivate%20Sub%20Worksheet_SelectionChange(ByVal%20Target%20As%20Range)%3CBR%20%2F%3E'Select%20Hyper-V%3CBR%20%2F%3EIf%20Range(%22B26%22)%20%3D%20%22Hyper-V%22%20Then%3CBR%20%2F%3ERows(%2228%3A29%22).EntireRow.Hidden%20%3D%20False%3CBR%20%2F%3EElse%3CBR%20%2F%3ERows(%2227%22).EntireRow.Hidden%20%3D%20True%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3E%3CBR%20%2F%3E'Select%20VMware%3CBR%20%2F%3EIf%20Range(%22B26%22)%20%3D%20%22VMware%22%20Then%3CBR%20%2F%3ERows(%2227%22).EntireRow.Hidden%20%3D%20False%3CBR%20%2F%3EElse%3CBR%20%2F%3ERows(%2228%3A29%22).EntireRow.Hidden%20%3D%20True%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20worked%20once%20or%20twice%20then%20it%20stopped%20working.%20Now%20what%20is%20happening%20is%20I%20can%20choose%20VMware%20from%20the%20dropdown%20and%20it%20shows%20and%20hides%20the%20correct%20lines.%20However%2C%20when%20I%20change%20the%20field%20to%20Hyper-V%2C%20it%20does%20not%20remove%20the%20VMware%20rows%20and%20replace%20them%20with%20the%20Hyper-V%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3EJerry%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1887435%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1887435%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F869025%22%20target%3D%22_blank%22%3E%40Jerry_Reddick%3C%2FA%3E%26nbsp%3BTry%20this%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EPrivate%20Sub%20Worksheet_SelectionChange(ByVal%20Target%20As%20Range)%0A%0ASelect%20Case%20Range(%22B26%22)%0A%0ACase%20%22Hyper-V%22%0A%20%20%20%20Rows(%2228%3A29%22).EntireRow.Hidden%20%3D%20False%0A%20%20%20%20Rows(%2227%22).EntireRow.Hidden%20%3D%20True%0A%0ACase%20%22VMware%22%0A%20%20%20%20Rows(%2227%22).EntireRow.Hidden%20%3D%20False%0A%20%20%20%20Rows(%2228%3A29%22).EntireRow.Hidden%20%3D%20True%0A%0AEnd%20Select%0A%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1888897%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20-%20automatically%20hiding%20select%20rows%20based%20on%20drop%20down%20selection%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1888897%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%20and%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F869025%22%20target%3D%22_blank%22%3E%40Jerry_Reddick%3C%2FA%3E%26nbsp%3B%20for%20your%20responses.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EYes%2C%20for%20me%2C%20I%20am%20able%20to%20hide%20specific%20rows%20for%20my%20worksheet.%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CBR%20%2F%3EThis%20is%20the%20code%20I%20am%20using%20%3A%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CI%3E%3CFONT%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20If%20Range(%22C14%22)%20%3D%20%22Residential%20refinance%22%20Then%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2218%3A19%22).EntireRow.Hidden%20%3D%20False%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Else%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2218%3A19%22).EntireRow.Hidden%20%3D%20True%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20End%20If%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20If%20Range(%22C21%22)%20%3D%20%22Medico%22%20Then%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2244%3A45%22).EntireRow.Hidden%20%3D%20True%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Else%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2244%3A45%22).EntireRow.Hidden%20%3D%20False%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20End%20If%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20If%20Range(%22C32%22)%20%3D%20%22Yes%22%20Then%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2234%3A37%22).EntireRow.Hidden%20%3D%20False%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Else%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Rows(%2234%3A37%22).EntireRow.Hidden%20%3D%20True%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20End%20If%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20End%20Sub%3C%2FFONT%3E%3C%2FI%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CI%3E__________________________________________%3C%2FI%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%3CI%3EHowever%2C%20until%20now%20I%20wasnt%20able%20to%20hide%20the%20rows%20for%20each%20of%20the%20two%20options%20from%20Cell%20C21%20dropdown%20-%20only%20one.%3C%2FI%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CI%3EWhen%20I%20select%20the%20other%20option%2C%20both%20follow-up%20questions%20remain%20visible%20(rows%2042%3A43)%20%26amp%3B%20rows%20(44%3A45).%20I%20will%20now%20try%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%20's%20code%20because%20it%20seems%20like%20that%20might%20allow%20me%20to%20only%20keep%20one%20specific%20question%20(either%20rows%2042%3A43%20or%20rowas44%3A45)%20visible%20depending%20on%20the%20dropdown%20option%20selected%20from%20cell%20C21.%3C%2FI%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CI%3EOther%20than%20that%2C%20my%20code%20has%20been%20running%20properly%20so%20far%20(key%20word%3A%20So%20far).%26nbsp%3B%20Lets%20see%20how%20it%20behaves%20once%20I%20share%20the%20Excelsheet%20with%20my%20end-users.%20(coz%20that's%20usually%20when%20it%20begins%20to%20act%20up%20usually)%26nbsp%3B%3C%2FI%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CI%3EThank%20you%20guys!%3C%2FI%3E%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor
Hi there! I have a drop down selection of 10 items on my dashboard tab and am trying to only show rows 57 to 72 when I select one of them. I am using the following code but somehow it is not working and my dashboard does not change at all. However, when I key in something into a random cell, the page reloads and rows 57:72 become hidden. But then, it stays the same across all my selections and I cannot unhide it again through the drop box selection. May I know if anyone has an alternative suggestion? Thank you in advance!
 
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 2 And Target.Row = 3 And Target.Value = "1"
Then Application.Rows("57:72").Select Application.Selection.EntireRow.Hidden = False
Else Application.Rows("57:72").Select Application.Selection.EntireRow.Hidden = True
End If
End Sub
15 Replies

Hi,

 

If I understand you well, you want to show rows 57 to 72 when you select the value of 1 from the dropdown list, otherwise, you want to hide them.
I think that the dropdown list in cell B3?

 

Based on that, please try this code instead:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("B3") = "1" Then
        Rows("57:72").EntireRow.Hidden = False
    Else
        Rows("57:72").EntireRow.Hidden = True
    End If
End Sub

Thanks Haytham, unfortunately it seems like it is my excel sheet that is causing the problem. The same issue remains (that the bars don't get hidden until I type something into cell J3, after which it does not unhide again). I tried your method on a new excel file and it worked. If you happen to know how I can troubleshoot this issue please let me know. Thank you!

Hi,

 

Please provide me with screenshots of your dashboard to figure out what the problem is.

It's best if you can attach the workbook.

@Haytham Amairah 

Thank you for the info on how to use a macro to hide rows.  I have a question as an extension to the first question.

 

I see how you hide rows based on the content of a cell.  Is it also possible to use the same macro to set the print area of the document so that it prints the rows that are still active?

 

Thanks,

wmsawchuk 

@wmsawchuk

 

Yes, that's possible!

Try this code:

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("B3") = "1" Then
Rows("10:15").EntireRow.Hidden = False
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$15"
Else
Rows("10:15").EntireRow.Hidden = True
ActiveSheet.PageSetup.PrintArea = "$A$1:$H$9"
End If
End Sub

@Haytham Amairah 

 

Thank you very much for the code to set the print area.  It works great and I really appreciate your help.

maybe the other way round...
ALT + F11 and click on the desired picture, copy the code ... change the lines as desired beforehand.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Bereich As Range, Berechnung As Long
Berechnung = Application.Calculation
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = False
Me.Unprotect ("1234")
Set Bereich = Intersect(Target, Range("A15:A1009"))
If Not Bereich Is Nothing Then
Application.EnableEvents = False
Range("A15:A1009").EntireRow.Hidden = False
Range("A10:A1000").EntireRow.AutoFit
Range("A" & 45 + WorksheetFunction.CountA( _
Range("A15:A1009")) & ":A1009").EntireRow.Hidden = True
End If
Me.Protect ("1234")
Application.EnableEvents = True
Application.Calculation = Berechnung
Application.ScreenUpdating = True
End Sub

Regards,
Nikolino
(Knows I don't know anything)
desired picture = disired sheet

@Haytham Amairah 

 

I am looking to create a worksheet where a user is presented with different options (more than 2 options) from a dropdown and based on their responses (i.e if user chooses any one of 2 options - eg. choice A or choice B), a new question appears on the Excelsheet in a row below the first question, otherwise they don't.

 

And then based on the users' response to this second question (posed as a dropdown choice), a third question appears or does not appear.

 

As is obvious, I am seeking to have several nested questions within the Excelsheet where each subsequent question shows up as a Dropdown based on the user's response from a previous question (also a dropdown). 

 

I am able to create dropdowns for each question and create one of the questions to appear based on a prior question, but am having trouble going any further.

 

Any help would be much appreciated. Thank you!

@RishiSumit 

Perhaps you mean nested drop-down list. See, for example, https://www.youtube.com/watch?v=7mo4COng7Sg

Learn how you can create MULTIPLE dependent data validation lists in Excel on the SAME sheet. In this video I'll show you a solution that requires ONE single...
Thanks Sergei.

This video shows how to draw data from a dropdown list that is visible on the Excel sheet regardless of the user's response.

However, I am trying to make a sheet where a follow up question (& its associated dropdown list) does not become visible unless user chooses either say option C or D (out of 6 options a,b,c,d,e,f). Once user chooses option c or d --> then the next question (& its dropdown list) appears in the following row.

Thank you,

@RishiSumit This is exactly what I am trying to do.  Did you find a resolution? I originally created this structure:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Select Hyper-V
If Range("B26") = "Hyper-V" Then
Rows("28:29").EntireRow.Hidden = False
Else
Rows("27").EntireRow.Hidden = True
End If

'Select VMware
If Range("B26") = "VMware" Then
Rows("27").EntireRow.Hidden = False
Else
Rows("28:29").EntireRow.Hidden = True
End If
End Sub

 

It worked once or twice then it stopped working. Now what is happening is I can choose VMware from the dropdown and it shows and hides the correct lines. However, when I change the field to Hyper-V, it does not remove the VMware rows and replace them with the Hyper-V rows.

 

Thanks,

Jerry

@Jerry_Reddick Try this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Select Case Range("B26")

Case "Hyper-V"
    Rows("28:29").EntireRow.Hidden = False
    Rows("27").EntireRow.Hidden = True

Case "VMware"
    Rows("27").EntireRow.Hidden = False
    Rows("28:29").EntireRow.Hidden = True

End Select

End Sub

 

Thanks @Riny_van_Eekelen and @Jerry_Reddick  for your responses.

 

Yes, for me, I am able to hide specific rows for my worksheet.


This is the code I am using :

 

Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("C14") = "Residential refinance" Then
        Rows("18:19").EntireRow.Hidden = False
    Else
        Rows("18:19").EntireRow.Hidden = True
    End If
   
    If Range("C21") = "Medico" Then
        Rows("44:45").EntireRow.Hidden = True
    Else
        Rows("44:45").EntireRow.Hidden = False
       
    End If
   
        If Range("C32") = "Yes" Then
        Rows("34:37").EntireRow.Hidden = False
    Else
        Rows("34:37").EntireRow.Hidden = True
    End If
    End Sub

 

__________________________________________

However, until now I wasnt able to hide the rows for each of the two options from Cell C21 dropdown - only one.

 

When I select the other option, both follow-up questions remain visible (rows 42:43) & rows (44:45). I will now try @Riny_van_Eekelen 's code because it seems like that might allow me to only keep one specific question (either rows 42:43 or rowas44:45) visible depending on the dropdown option selected from cell C21.

 

Other than that, my code has been running properly so far (key word: So far).  Lets see how it behaves once I share the Excelsheet with my end-users. (coz that's usually when it begins to act up usually) 

 

Thank you guys!