Solved

Excel: Extract Comments With Name to Separate Worksheet with VBA

Posted on 2014-01-30
2
430 Views
Last Modified: 2014-01-31
All:

I have been a member for several years and love Experts Exchange.
I usually find what I need by searching and have rarely had to ask a question.
At this point, however, I haven't found what I need and don't exactly know how to go about it.  

Basically I have a row of data.  In that row of data I have information contained in the cells and several cells with comments as well.

I would like to extract the name on the row and the comments on that same row to another worksheet.  The name and the comments should be in the correct order in separate cells in the same row on the new worksheet.

I'm looking for something like:
Name           Comment 1           Comment 2           Comment 3

I have uploaded a sample spreadsheet to show the original data layout (Input) and the desired output (Output).

I am not new to programming, however, please explain any proposed solution in programming comments if you don't mind.  I find I always learn something that way.

Thanks in advance for any assistance you may be able to provide.
CommentExtractExample.xlsm
0
Comment
Question by:jbcarrico
2 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39821548
Hi,

pls try

Sub macro4()
Sheets("Input").Activate
For Each c In Sheets("Input").Range(Range("A5"), Range("A" & Cells.Rows.Count).End(xlUp))
    Sheets("Output").Range("A" & c.Row - 3) = c
    Sheets("Output").Range("B" & c.Row - 3) = c.Offset(0, 4).Comment.Text
    Sheets("Output").Range("C" & c.Row - 3) = c.Offset(0, 5).Comment.Text
    Sheets("Output").Range("D" & c.Row - 3) = c.Offset(0, 6).Comment.Text
    Sheets("Output").Range("E" & c.Row - 3) = c.Offset(0, 7).Comment.Text
Next
End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:jbcarrico
ID: 39823977
Rgonzo1971:

This is exactly what I needed.
Thanks so much for your quick response.
The only thing I needed to add was "On Error Resume Next" because some of the fields in my Comments matrix didn't have comments.

Thanks so much.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question