vba - Worksheet_Change to hide rows in Excel -
I have a macro that should hide one row in Excel, when the value of a given cell is "ODD" (the word , Not a weird number). I have tried two different formats; Neither gives any visible error, but neither hides the row
sub-worksheet tag (target voltage as range) if target. Address & lt; & Gt; Exclude "$ B $ 2", then sub alceph range ("B2"). Value = "ODD" then the rows ("5: 5"). EntireRow.Hidden = False Else Rows ("5: 5"). EntireRow.Hidden = If the end is end if end is the other I have other code:
Choose the case range ("B2"). The value is the case = "ODD" ": Rows (" 5: 5 "). EntireRow.Hidden = Bad case Other: Rows (" 5: 5 "). EntireRow.Hidden = True End Select It was modified from another advanced case statement and I have already left it.
from B2 to Compare ODD already produces true or wrong , if you distribute it with rows (" 5: 5 ") would be better rows (5) . The method you use will be better as the range (" 5: 5 ").
Sub-worksheet tag (target by target in range) if target Address = "$ B $ 2" then the lines (5). Antirer.Hadded = (UCS (target.value) = "ODD") if the ending if / other / end / Comparison of text in VBA is generally sensitive, so to emphasize the sensitivity of the case for the requirement of UCase .
Comments
Post a Comment