Results 1 to 2 of 2
2004-08-04, 11:50 #1
- Join Date
- Feb 2001
- Louisville, Kentucky, USA
- 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
If Not Intersect(Target, Range("D34")) Is Nothing And Range("D34") = "No" Then
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>
2004-08-04, 12:29 #2
- Join Date
- Jul 2002
- Pittsburgh, Pennsylvania, USA
- 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:
[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.