Hiding named ranges depending on a cell value

  • Thread starter Thread starter Ctech
  • Start date Start date
C

Ctech

Hi I ahve a combo box, which changes the value in cell depending on the
choice u pick. the bumber in the cell is either the letter A, or the
letter B

My problem is that the macro doesn't hide or unhides... and I can' seem
to understand what the problem is...

Can anyone see the error in the macro below?


Macro:


Sub Hide_unhide_date_period()

' This procedure hides and displays the dates / period input cells
depending on the CC selection on the front sheet.
' Written by Christian Simonsen 17/03/06

Dim myCell As Range

With Application
ScreenUpdating = False
DisplayAlerts = False
End With

Set myCell = ActiveCell


If Worksheets("TM1").Range("G15") = "A" Then
Range("Project_Periods").Select
Selection.EntireRow.Hidden = False

Range("Project_dates").Select
Selection.EntireRow.Hidden = True

ElseIf Worksheets("TM1").Range("G15") = "B" Then

Range("Project_Periods").Select
Selection.EntireRow.Hidden = True

Range("Project_dates").Select
Selection.EntireRow.Hidden = False

End If


myCell.Select

With Application
ScreenUpdating = True
DisplayAlerts = True
End With

End Sub
 
Hi Ctech,

Had a similar case ... following is working for me :
ActiveSheet.Range("A14:A18").EntireRow.Hidden = False

HTH
Cheers
Carim
 
Hi Ctech,

Had a similar case ... following is working for me :
ActiveSheet.Range("A14:A18").EntireRow.Hidden = False

HTH
Cheers
Carim


That is exactly what I ahve done, isn't it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top