Comment instead of Data Validation

G

Guest

I need to add comments to cells - data validation doesn't work because of the
size limitations in terms of both the size of the data validation box and
the number of characters - so I prefer to simply add regular comments.

However, I wish the comment to appear when I simply click in a cell (or hit
Tab, arrow, etc) I posted within the last few days on this, and received a
response, but it didn't work.
 
Joined
May 7, 2007
Messages
16
Reaction score
0
So you want comments in cells that come into view when the cell is selected?
Then put this into your Worksheet_SelectionChange:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
on error resume next
Target.Comment.Visible = True
if not rLastTarget is nothing then
rLastTarget.Comment.Visible = False
end if
set rLastTarget = Target
End Sub

and you should also put this into the module:
Private rLastTarget As Range

How it works:
When you select a cell in your sheet the comment in the cell will become visible. If you've already selected a cell that had a comment, the previous comment will become invisible and and the current selection becomes visible.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top