ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Toggle Text in a column to be visible or not visible (https://www.excelbanter.com/excel-programming/287207-toggle-text-column-visible-not-visible.html)

Dave Y[_3_]

Toggle Text in a column to be visible or not visible
 
I have a report in an Excel 2002 spreadsheet that is
presented quartely. There is a column that contains
comments that I need for my own use but when the report
is presented to the Board only the comment of "Special
Mention" needs to be shown. My question is; How can I
make the text in the column containing the comments that
I don't want visible to be not visible? (the only comment
showing would be "special mention") Also I need some way
to be able to toggle back and forth between making the
text visible and not visible. I was thinking of using two
buttons, each containing the code that would serve my
purpose, but I am unsure of how to do this. Any help with
a solution or pointing me in the proper direction will be
greatly appreciated. Thank you.
Dave

patrick molloy

Toggle Text in a column to be visible or not visible
 
set the text's COLOR to the same as the cell's background
color. This will make the writing seem to disappear.

the following test should be stepped through using
shift+F8
The first test line will make the text vanish & th
esecong will make it appear. First select some cells with
text . try changing the cells color.

Sub test()

Reset Selection, False
Reset Selection, True

End Sub

Sub Reset(cell As Range, Optional bShow As Boolean = True)
Dim clr As Long
With cell

If bShow Then
.Font.ColorIndex = 0
Else
clr = .Interior.ColorIndex
If .Interior.ColorIndex < 0 Then
clr = 2
End If
.Font.ColorIndex = clr
End If
End With
End Sub


Patrick Molloy
Microsoft Excel MVP

-----O

riginal Message-----
I have a report in an Excel 2002 spreadsheet that is
presented quartely. There is a column that contains
comments that I need for my own use but when the report
is presented to the Board only the comment of "Special
Mention" needs to be shown. My question is; How can I
make the text in the column containing the comments that
I don't want visible to be not visible? (the only

comment
showing would be "special mention") Also I need some way
to be able to toggle back and forth between making the
text visible and not visible. I was thinking of using

two
buttons, each containing the code that would serve my
purpose, but I am unsure of how to do this. Any help

with
a solution or pointing me in the proper direction will

be
greatly appreciated. Thank you.
Dave
.


Dave Y[_3_]

Toggle Text in a column to be visible or not visible
 
Hey Patrick,

Thank you for your quick reply. I will be giving it a try
very soon. Thanks again.

Dave
-----Original Message-----
set the text's COLOR to the same as the cell's background
color. This will make the writing seem to disappear.

the following test should be stepped through using
shift+F8
The first test line will make the text vanish & th
esecong will make it appear. First select some cells with
text . try changing the cells color.

Sub test()

Reset Selection, False
Reset Selection, True

End Sub

Sub Reset(cell As Range, Optional bShow As Boolean = True)
Dim clr As Long
With cell

If bShow Then
.Font.ColorIndex = 0
Else
clr = .Interior.ColorIndex
If .Interior.ColorIndex < 0 Then
clr = 2
End If
.Font.ColorIndex = clr
End If
End With
End Sub


Patrick Molloy
Microsoft Excel MVP

-----O

riginal Message-----
I have a report in an Excel 2002 spreadsheet that is
presented quartely. There is a column that contains
comments that I need for my own use but when the report
is presented to the Board only the comment of "Special
Mention" needs to be shown. My question is; How can I
make the text in the column containing the comments that
I don't want visible to be not visible? (the only

comment
showing would be "special mention") Also I need some way
to be able to toggle back and forth between making the
text visible and not visible. I was thinking of using

two
buttons, each containing the code that would serve my
purpose, but I am unsure of how to do this. Any help

with
a solution or pointing me in the proper direction will

be
greatly appreciated. Thank you.
Dave
.

.


Michel Pierron[_2_]

Toggle Text in a column to be visible or not visible
 
another solution by change of format:
Sub Reset(cell As Range, Optional bShow As Boolean = True)
If bShow Then
cell.NumberFormat = "General"
Else
cell.NumberFormat = ";;;"
End If
End Sub

MP

"Patrick Molloy" a écrit dans le message de
...
set the text's COLOR to the same as the cell's background
color. This will make the writing seem to disappear.

the following test should be stepped through using
shift+F8
The first test line will make the text vanish & th
esecong will make it appear. First select some cells with
text . try changing the cells color.

Sub test()

Reset Selection, False
Reset Selection, True

End Sub

Sub Reset(cell As Range, Optional bShow As Boolean = True)
Dim clr As Long
With cell

If bShow Then
.Font.ColorIndex = 0
Else
clr = .Interior.ColorIndex
If .Interior.ColorIndex < 0 Then
clr = 2
End If
.Font.ColorIndex = clr
End If
End With
End Sub


Patrick Molloy
Microsoft Excel MVP

-----O

riginal Message-----
I have a report in an Excel 2002 spreadsheet that is
presented quartely. There is a column that contains
comments that I need for my own use but when the report
is presented to the Board only the comment of "Special
Mention" needs to be shown. My question is; How can I
make the text in the column containing the comments that
I don't want visible to be not visible? (the only

comment
showing would be "special mention") Also I need some way
to be able to toggle back and forth between making the
text visible and not visible. I was thinking of using

two
buttons, each containing the code that would serve my
purpose, but I am unsure of how to do this. Any help

with
a solution or pointing me in the proper direction will

be
greatly appreciated. Thank you.
Dave
.




No Name

Toggle Text in a column to be visible or not visible
 
Thank you Michel
-----Original Message-----
another solution by change of format:
Sub Reset(cell As Range, Optional bShow As Boolean = True)
If bShow Then
cell.NumberFormat = "General"
Else
cell.NumberFormat = ";;;"
End If
End Sub

MP

"Patrick Molloy" a écrit dans

le message de
...
set the text's COLOR to the same as the cell's

background
color. This will make the writing seem to disappear.

the following test should be stepped through using
shift+F8
The first test line will make the text vanish & th
esecong will make it appear. First select some cells

with
text . try changing the cells color.

Sub test()

Reset Selection, False
Reset Selection, True

End Sub

Sub Reset(cell As Range, Optional bShow As Boolean =

True)
Dim clr As Long
With cell

If bShow Then
.Font.ColorIndex = 0
Else
clr = .Interior.ColorIndex
If .Interior.ColorIndex < 0 Then
clr = 2
End If
.Font.ColorIndex = clr
End If
End With
End Sub


Patrick Molloy
Microsoft Excel MVP

-----O

riginal Message-----
I have a report in an Excel 2002 spreadsheet that is
presented quartely. There is a column that contains
comments that I need for my own use but when the report
is presented to the Board only the comment of "Special
Mention" needs to be shown. My question is; How can I
make the text in the column containing the comments

that
I don't want visible to be not visible? (the only

comment
showing would be "special mention") Also I need some

way
to be able to toggle back and forth between making the
text visible and not visible. I was thinking of using

two
buttons, each containing the code that would serve my
purpose, but I am unsure of how to do this. Any help

with
a solution or pointing me in the proper direction will

be
greatly appreciated. Thank you.
Dave
.



.



All times are GMT +1. The time now is 07:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com