Solved

Excel: Extract Comments With Name to Separate Worksheet with VBA

Posted on 2014-01-30
2
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
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!
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
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…

740 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