Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Toggle text to be visible and not visible

I sent in a post a couple of days ago and did receive
some
replies that I am grateful for; but I am still stuck. I
don't have much experience with VBA and I need help. I
have a report that gets presented quartley. There is a
column on the spreadsheet that contains 2 types of
comments. One type of comments are for myself to keep
track of things. The other comments are meant for the
Board members to see when the report is presented. What I
want to do is have two buttons on the spreadsheet; one
button to remove all the comments that the board does not
want to see. The only comment the board wants to see are
the words "Special Mention". The other button is to
restore all of my comments that I need for myself while
I'm working on the report. In other words when I click on
a button named (let's say)Special Mention, all text in
the
column should go away except for the words "Special
Mention. So far I have been able to either make all the
text either be visible or not with the following code:

Private Sub cmdViewComments_Click()
Worksheets("Sheet1").Range("Comments").Font.Color
= RGB(0, 0, 0)

End Sub

Private Sub cmdSpecialMention_Click()
Worksheets("Sheet1").Range("Comments").Font.Color
= RGB(255, 255, 255)
End Sub

I need help with the code to enable me to only display
the
words/text "Special Mention" in the Comments column. I
know this is a long post and I appreciate the patience in
reading it. Thank you for any help provoided. Dave
PS This is the second time I'm posting the exact same
post; it never appeared the first time.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Toggle text to be visible and not visible

Try this, add this code to your buttons click event. This will change all
the cells in the range that have the words "Special Mention" in them to
white. Just change the color number to whatever color you want for your
sheet. For your other button just add the same code except change the equal
to sign to < and then change the color number to your desired color.
For Each cell In Range("B4:b20")
If cell.Value = "Special Mention" Then
cell.Font.ColorIndex = 2

End If
Next cell
HTH

"Dave Y" wrote in message
...
I sent in a post a couple of days ago and did receive
some
replies that I am grateful for; but I am still stuck. I
don't have much experience with VBA and I need help. I
have a report that gets presented quartley. There is a
column on the spreadsheet that contains 2 types of
comments. One type of comments are for myself to keep
track of things. The other comments are meant for the
Board members to see when the report is presented. What I
want to do is have two buttons on the spreadsheet; one
button to remove all the comments that the board does not
want to see. The only comment the board wants to see are
the words "Special Mention". The other button is to
restore all of my comments that I need for myself while
I'm working on the report. In other words when I click on
a button named (let's say)Special Mention, all text in
the
column should go away except for the words "Special
Mention. So far I have been able to either make all the
text either be visible or not with the following code:

Private Sub cmdViewComments_Click()
Worksheets("Sheet1").Range("Comments").Font.Color
= RGB(0, 0, 0)

End Sub

Private Sub cmdSpecialMention_Click()
Worksheets("Sheet1").Range("Comments").Font.Color
= RGB(255, 255, 255)
End Sub

I need help with the code to enable me to only display
the
words/text "Special Mention" in the Comments column. I
know this is a long post and I appreciate the patience in
reading it. Thank you for any help provoided. Dave
PS This is the second time I'm posting the exact same
post; it never appeared the first time.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Toggle text to be visible and not visible

Hey Cliff
Your code did the trick; it performed exactly what I need to do. Thank you very much for your reply and your help
Have a great day
Dave Y
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Toggle text to be visible and not visible

See your other post for a non-macro suggestion.

Dave Y wrote:

I sent in a post a couple of days ago and did receive
some
replies that I am grateful for; but I am still stuck. I
don't have much experience with VBA and I need help. I
have a report that gets presented quartley. There is a
column on the spreadsheet that contains 2 types of
comments. One type of comments are for myself to keep
track of things. The other comments are meant for the
Board members to see when the report is presented. What I
want to do is have two buttons on the spreadsheet; one
button to remove all the comments that the board does not
want to see. The only comment the board wants to see are
the words "Special Mention". The other button is to
restore all of my comments that I need for myself while
I'm working on the report. In other words when I click on
a button named (let's say)Special Mention, all text in
the
column should go away except for the words "Special
Mention. So far I have been able to either make all the
text either be visible or not with the following code:

Private Sub cmdViewComments_Click()
Worksheets("Sheet1").Range("Comments").Font.Color
= RGB(0, 0, 0)

End Sub

Private Sub cmdSpecialMention_Click()
Worksheets("Sheet1").Range("Comments").Font.Color
= RGB(255, 255, 255)
End Sub

I need help with the code to enable me to only display
the
words/text "Special Mention" in the Comments column. I
know this is a long post and I appreciate the patience in
reading it. Thank you for any help provoided. Dave
PS This is the second time I'm posting the exact same
post; it never appeared the first time.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrap Text Not Visible Randy Excel Discussion (Misc queries) 5 February 19th 08 09:49 PM
Visible text in a cell Ash New Users to Excel 2 November 9th 07 03:34 PM
Autoshapes not visible on spreadsheet but visible in print preview John Excel Discussion (Misc queries) 3 February 11th 05 10:23 PM
Toggle Text to be visible and Not visible Dave Y[_3_] Excel Programming 1 January 10th 04 07:16 PM
Toggle Text in a column to be visible or not visible Dave Y[_3_] Excel Programming 4 January 8th 04 08:46 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"