View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Conditional formatting - VBA

One way:

Insert this in the worksheet code module (right-click the worksheet tab
and choose View Code):

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Range("24:26").EntireRow.Hidden = (LCase(Range("C23")) = "no")
End Sub



In article ,
pls wrote:

i need instruction on a coding problem. i've determined it's not possible to
use conditional formatting to accomplish what i'm trying to achieve.

cell C23 is a drop down menu with choices "yes" and "no"
if c23 is no, i want rows 24-26 to be automatically hidden.

what is the VBA code for this, and how do i input it in the worksheet (step
by step)?