Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cell Contents Visible? (Excel 2K)

    Good Morning....once again,

    I have the following code that works fine....I just want to modify it a bit for the following reason:

    If the user selects "yes" then I want the contents in "I4" to be visible (this is a hyperlink) but if the user selects "no" then I want the contents in "I4" to NOT be visible.

    If Not Intersect(Target, Range("D34")) Is Nothing And Range("D34") = "Yes" Then
    Range("D37").Select

    Else

    If Not Intersect(Target, Range("D34")) Is Nothing And Range("D34") = "No" Then
    Range("D41").Select
    End If

    So how do I make this adjustment?

    I thought it would be simple like : Range("I4").visible=True/False...but that isn't valid.

    Does anyone have a suggestion?
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Cell Contents Visible? (Excel 2K)

    To hide the contents you could use:
    Range("I4").NumberFormat = ";;;"

    To unhide use:
    Range("I4").NumberFormat = "General"
    Or some other format as desired

    Note, selecting the cell will display its contents in the formulabar. You can hide the cell (format - cells -protection - hidden) to hide the contents from the formula bar, but the worksheet must be protected.

    You could also do it with a formula in I4:
    =IF(D4="Yes",HYPERLINK("http:www.wopr.com"),"")
    [Change the link as appropriate]

    The format way is still a hyperlink and will still work, the formula way will no longer have a link in the cell.
    Steve

Posting Permissions

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