Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel: Extract Comments With Name to Separate Worksheet with VBA

Posted on 2014-01-30
2
Medium Priority
?
438 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 53

Accepted Solution

by:
Rgonzo1971 earned 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

604 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