Hide/Unhide column based on cell value

G

Guest

I have a column ("H") that should be visible when the condition in the input
cell is TRUE, invisible when the value is FALSE. I set a breakpoint in the
function below and it never gets there.

Function HideUnhideH()
Application.Volatile
If Application.Worksheets("Inputs").Range("O7") = "Yes" Then
Application.Worksheets("Est&GiftLedgerPRINT").Range("O7") = True
Range("H16").Select
Selection.EntireColumn.Hidden = False
Else
Application.Worksheets("Est&GiftLedgerPRINT").Range("O7") = False
Range("H16").Select
Selection.EntireColumn.Hidden = True
End If
End Function

The print macro handles this when you go to print. I'm just trying to get
this to happen so the end user can see the changes based on his input before
he goes to print.
 
J

Jean-Yves

Hi,

A functiojn returns a value.
Use a sub to perform an action.
You could use the worksheet_change event to call a macro instead.
Regards,

Jean-Yves
 

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

Top