+ Reply to Thread
Results 1 to 3 of 3

Hide/Unhide column based on cell value

  1. #1
    DRK
    Guest

    Hide/Unhide column based on cell value

    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.
    --
    DRK

  2. #2
    Jean-Yves
    Guest

    Re: Hide/Unhide column based on cell value

    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

    "DRK" <[email protected]> wrote in message
    news:[email protected]...
    > 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.
    > --
    > DRK




  3. #3
    DRK
    Guest

    Re: Hide/Unhide column based on cell value

    I appreciate the help. I'm on the right track now. Thanks.
    --
    DRK


    "Jean-Yves" wrote:

    > 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
    >
    > "DRK" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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.
    > > --
    > > DRK

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1