Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 447

Drop down List to hide rows from one sheet to others

$
0
0

I want to have a drop down list with the name for example calculations, other and with choosing one I can have certain rows hidden on another sheet.Is there an easy way to do that?

I tried some codes but I do not understand the syntax since I am pulling from another sheet the cell value and changing on to three more sheets

Private Sub Worksheet_Change(ByVal Target As Range)    Sheets("Project&Site_Details").Rows("4:8").EntireRow.Hidden = IIf(Me.Range("c4").Value2 = "Server Migration", True, False)End Sub

This one keeps asking me for macro name.

So the basic idea is a dropdown on sheet Project&Site_Details on cell C4 with three names Server Migration, Data Type, Other. and have them hide or show rows on three different sheets according to the sheet. like Pre_Checklist, Post_Checklist

I got it to work using this code

Private Sub worksheet_change(ByVal target As Range)Dim KeyCells As RangeSet KeyCells = Range("C4")If Not Application.Intersect(KeyCells, Range(target.Address)) Is Nothing ThenIf KeyCells = "Server Migration" Then Sheets(3).Rows("4:4").Hidden = True  Sheets(3).Rows("5:5").Hidden = TrueElseSheets(3).Rows("4:4").Hidden = FalseSheets(3).Rows("5:5").Hidden = FalseEnd IfIf KeyCells = "Add-On" Then Sheets(3).Rows("10:11").Hidden = TrueElseSheets(3).Rows("10:11").Hidden = FalseEnd IfEnd IfEnd Sub

Is there any simpler way?


Viewing all articles
Browse latest Browse all 447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>