Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
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   Report Post  
Posted to microsoft.public.excel.misc
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   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
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   Report Post  
Posted to microsoft.public.excel.misc
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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
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   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
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   Report Post  
Posted to microsoft.public.excel.misc
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.
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 extract only certain data from a cell? Stan in South Africa Excel Discussion (Misc queries) 6 July 6th 08 08:44 PM
Is there a way to extract numbers from comments for use in a formu cadscout Excel Discussion (Misc queries) 1 November 10th 06 05:28 PM
let's allow printing comments as foot- or end-notes MattThom Excel Discussion (Misc queries) 1 January 22nd 06 11:37 PM
Extract Comments and paste as values Btibert Excel Discussion (Misc queries) 1 September 30th 05 10:02 PM
extract comments HJC Excel Discussion (Misc queries) 7 June 25th 05 04:30 PM


All times are GMT +1. The time now is 05:54 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"