A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Extract Cell Comments/Notes to data



 
 
Thread Tools Display Modes
  #1  
Old December 11th, 2008, 02:16 PM posted to microsoft.public.excel.misc
MSpaven75
external usenet poster
 
Posts: 5
Default Extract Cell Comments/Notes to data

I have a spreadsheet with Yes/No's a field values and all the meaningful data
as cell comments, I know there is a way to get these notes as cell contents
but can't remember how.

Ideas anyone?
  #2  
Old December 11th, 2008, 02:27 PM posted to microsoft.public.excel.misc
Gary''s Student
external usenet poster
 
Posts: 7,584
Default Extract Cell Comments/Notes to data

Lots of different ways.

Say we have comments in cells and want to put the data in the adjacent cell
to the right.

So if B9 had a comment, we want that text in C9.

Try this tiny macro:

Sub DisplayComments()
Dim c As Comment
If ActiveSheet.Comments.Count = 0 Then Exit Sub
For Each c In ActiveSheet.Comments
Range(c.Parent.Address).Offset(0, 1).Value = c.Text
Next
End Sub

--
Gary''s Student - gsnu200819


"MSpaven75" wrote:

I have a spreadsheet with Yes/No's a field values and all the meaningful data
as cell comments, I know there is a way to get these notes as cell contents
but can't remember how.

Ideas anyone?

  #3  
Old December 11th, 2008, 02:34 PM posted to microsoft.public.excel.misc
MSpaven75
external usenet poster
 
Posts: 5
Default Extract Cell Comments/Notes to data

How do I use it though, I can't remember how to edit MACRO's/VBA (been ages!!!)

"Gary''s Student" wrote:

Lots of different ways.

Say we have comments in cells and want to put the data in the adjacent cell
to the right.

So if B9 had a comment, we want that text in C9.

Try this tiny macro:

Sub DisplayComments()
Dim c As Comment
If ActiveSheet.Comments.Count = 0 Then Exit Sub
For Each c In ActiveSheet.Comments
Range(c.Parent.Address).Offset(0, 1).Value = c.Text
Next
End Sub

--
Gary''s Student - gsnu200819


"MSpaven75" wrote:

I have a spreadsheet with Yes/No's a field values and all the meaningful data
as cell comments, I know there is a way to get these notes as cell contents
but can't remember how.

Ideas anyone?

  #4  
Old December 11th, 2008, 02:36 PM posted to microsoft.public.excel.misc
Max
external usenet poster
 
Posts: 8,574
Default Extract Cell Comments/Notes to data

I use this UDF (from David M, IIRC)

Function MyComment(rng As Range)
Application.Volatile
Dim str As String
str = Trim(rng.Comment.Text)
'// If you want to remove Chr(10) character from string, then
str = Application.Substitute(str, vbLf, " ")
MyComment = str
End Function


In Excel,
use it in say, B1: =mycomment(A1)
to return A1's "Comment" contents
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:21,000 Files:365 Subscribers:65
xdemechanik
---
"MSpaven75" wrote:
I have a spreadsheet with Yes/No's a field values and all the meaningful data
as cell comments, I know there is a way to get these notes as cell contents
but can't remember how.

Ideas anyone?

  #5  
Old December 11th, 2008, 02:42 PM posted to microsoft.public.excel.misc
MSpaven75
external usenet poster
 
Posts: 5
Default Extract Cell Comments/Notes to data

Thanks, but, again, I have forgotten hopw to create UDF's etc. (it was a UDF
I have used before)

Can someone talk me through as if I were daft? (which I am not, honest)

"Max" wrote:

I use this UDF (from David M, IIRC)

Function MyComment(rng As Range)
Application.Volatile
Dim str As String
str = Trim(rng.Comment.Text)
'// If you want to remove Chr(10) character from string, then
str = Application.Substitute(str, vbLf, " ")
MyComment = str
End Function


In Excel,
use it in say, B1: =mycomment(A1)
to return A1's "Comment" contents
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:21,000 Files:365 Subscribers:65
xdemechanik
---
"MSpaven75" wrote:
I have a spreadsheet with Yes/No's a field values and all the meaningful data
as cell comments, I know there is a way to get these notes as cell contents
but can't remember how.

Ideas anyone?

  #6  
Old December 11th, 2008, 02:46 PM posted to microsoft.public.excel.misc
Jarek Kujawa[_2_]
external usenet poster
 
Posts: 775
Default Extract Cell Comments/Notes to data

Toools-Macros-select a macro, then click on Edit button to the right


On 11 Gru, 15:34, MSpaven75
wrote:
How do I use it though, I can't remember how to edit MACRO's/VBA (been ages!!!)



"Gary''s Student" wrote:
Lots of different ways.


Say we have comments in cells and want to put the data in the adjacent cell
to the right.


So if B9 had a comment, we want that text in C9.


Try this tiny macro:


Sub DisplayComments()
Dim c As Comment
If ActiveSheet.Comments.Count = 0 Then Exit Sub
For Each c In ActiveSheet.Comments
* * Range(c.Parent.Address).Offset(0, 1).Value = c.Text
Next
End Sub


--
Gary''s Student - gsnu200819


"MSpaven75" wrote:


I have a spreadsheet with Yes/No's a field values and all the meaningful data
as cell comments, I know there is a way to get these notes as cell contents
but can't remember how.


Ideas anyone?- Ukryj cytowany tekst -


- Pokaż cytowany tekst -


  #7  
Old December 11th, 2008, 02:55 PM posted to microsoft.public.excel.misc
Max
external usenet poster
 
Posts: 8,574
Default Extract Cell Comments/Notes to data

No problem, here's the steps to install it:

Press Alt+F11 to go to VBE
Click InsertModule
Copy n paste the UDF (or Sub) into the code window (whitespace on the right)
Press Alt+Q to get back to Excel

--
Max
Singapore
http://savefile.com/projects/236895
Downloads:21,000 Files:365 Subscribers:65
xdemechanik
---
"MSpaven75" wrote:
Thanks, but, again, I have forgotten how to create UDF's etc. (it was a UDF
I have used before)

Can someone talk me through as if I were daft? (which I am not, honest)


  #8  
Old December 11th, 2008, 02:58 PM posted to microsoft.public.excel.misc
MSpaven75
external usenet poster
 
Posts: 5
Default Extract Cell Comments/Notes to data

Thanks to those who helped, this is now working.

I'll make a two pint donation to the "I like beer, buy me beer" fund over
the weekend.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:27 PM.


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