Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying cell comments.

How do I make a cell display the cell comments only when the cell is active?
I am using Excel 2000.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Displaying cell comments.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B4").Comment.Visible = Not (Intersect(Target, Range("B4")) Is
Nothing)
End Sub

--
- K Dales


"Dan N" wrote:

How do I make a cell display the cell comments only when the cell is active?
I am using Excel 2000.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Displaying cell comments.

To K Dales - Thank you. That worked great!
If I want to do the same thing in other cells on the same spreadsheet, what
should I do? - Dan N.

"K Dales" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B4").Comment.Visible = Not (Intersect(Target, Range("B4")) Is
Nothing)
End Sub

--
- K Dales


"Dan N" wrote:

How do I make a cell display the cell comments only when the cell is active?
I am using Excel 2000.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Displaying cell comments.

If there are only a few cells with comments, I would just duplicate the line
of code that toggles the comment for each of them:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B4").Comment.Visible = Not (Intersect(Target, Range("B4")) Is
Nothing)
Range("C5").Comment.Visible = Not (Intersect(Target, Range("C5")) Is
Nothing)
...
End Sub

But if there are many of them, and/or you may add or delete other comments
in the future, the following is a general method to find and toggle all
comments on the sheet - only disadvantage is it runs a bit slower and you may
note the lag as the comments toggle on/off:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ThisCell As Range

For Each ThisCell In Me.Cells.SpecialCells(xlCellTypeComments)
ThisCell.Comment.Visible = Not (Intersect(Target, ThisCell) Is Nothing)
Next ThisCell

End Sub

--
- K Dales


"Dan N" wrote:

To K Dales - Thank you. That worked great!
If I want to do the same thing in other cells on the same spreadsheet, what
should I do? - Dan N.

"K Dales" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B4").Comment.Visible = Not (Intersect(Target, Range("B4")) Is
Nothing)
End Sub

--
- K Dales


"Dan N" wrote:

How do I make a cell display the cell comments only when the cell is active?
I am using Excel 2000.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Displaying cell comments.

To K Dales - That worked absolutely great! Thank you so much for your help. I
really appreciate it.
- Dan N

"K Dales" wrote:

If there are only a few cells with comments, I would just duplicate the line
of code that toggles the comment for each of them:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B4").Comment.Visible = Not (Intersect(Target, Range("B4")) Is
Nothing)
Range("C5").Comment.Visible = Not (Intersect(Target, Range("C5")) Is
Nothing)
...
End Sub

But if there are many of them, and/or you may add or delete other comments
in the future, the following is a general method to find and toggle all
comments on the sheet - only disadvantage is it runs a bit slower and you may
note the lag as the comments toggle on/off:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ThisCell As Range

For Each ThisCell In Me.Cells.SpecialCells(xlCellTypeComments)
ThisCell.Comment.Visible = Not (Intersect(Target, ThisCell) Is Nothing)
Next ThisCell

End Sub

--
- K Dales


"Dan N" wrote:

To K Dales - Thank you. That worked great!
If I want to do the same thing in other cells on the same spreadsheet, what
should I do? - Dan N.

"K Dales" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("B4").Comment.Visible = Not (Intersect(Target, Range("B4")) Is
Nothing)
End Sub

--
- K Dales


"Dan N" wrote:

How do I make a cell display the cell comments only when the cell is active?
I am using Excel 2000.

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
How do I print, displaying comments on XL Spreadsheet? Dawn Corbyn Excel Discussion (Misc queries) 1 October 28th 08 11:14 AM
displaying comments JT Excel Discussion (Misc queries) 1 October 14th 08 10:39 PM
Comments Not displaying Correctly With Panes Frozen? Mattie Excel Discussion (Misc queries) 1 May 8th 07 05:31 PM
UDF code to find specific text in cell comments, then average cell values bruch04 Excel Programming 3 December 5th 05 10:01 PM
Displaying Cells Comments Jmbostock[_5_] Excel Programming 1 January 3rd 04 11:12 AM


All times are GMT +1. The time now is 01:54 PM.

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"