• About
  • Contact
  • Privacy Policy
  • Submit For Review
  • Template Gallery
  • Excel 2016 Udemy Course
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

TheAppTimes

App Reviews, Tutorials, & Gadget News Hub

  • Gadgets
  • How To
  • Mobile Apps
  • Software and Web Apps
  • Buying Guides
  • Show Search
Hide Search
Home » How To » How to Extract Comments in an Excel Sheet

How to Extract Comments in an Excel Sheet

December 14, 2011

Comment boxes are great when you want to share additional information about Excel data. You can view all comments on a worksheet or just specific comments you want to see.  However, there may be times when you need to consolidate the comments in an Excel worksheet. In this post, we show you how to extract comments in an Excel Sheet using a macro.

If you have never created a macro before, you can learn how to do it in an easy way, without writing the codes yourself, using a macro recorder. You can read more about how to do that here.

HOW TO EXTRACT COMMENTS IN AN EXCEL SHEET

To extract comments in an Excel sheet and move it to another worksheet you need to use a User defined function. That is, custom functions that you can create yourself.

1. To get started, copy this code.

Sub ShowCommentsAllSheets()
 'modified from code
 'posted by Dave Peterson 2003-05-16
 Application.ScreenUpdating = False
 
 Dim commrange As Range
 Dim mycell As Range
 Dim ws As Worksheet
 Dim newwks As Worksheet
 Dim i As Long
 
 Set newwks = Worksheets.Add
 
 newwks.Range("A1:E1").Value = _
 Array("Sheet", "Address", "Name", "Value", "Comment")
 
 For Each ws In ActiveWorkbook.Worksheets
 On Error Resume Next
 Set commrange = ws.Cells.SpecialCells(xlCellTypeComments)
 On Error GoTo 0
 
 If commrange Is Nothing Then
 'do nothing
 Else
 
 i = newwks.Cells(Rows.Count, 1).End(xlUp).Row
 
 For Each mycell In commrange
 With newwks
 i = i + 1
 On Error Resume Next
 .Cells(i, 1).Value = ws.Name
 .Cells(i, 2).Value = mycell.Address
 .Cells(i, 3).Value = mycell.Name.Name
 .Cells(i, 4).Value = mycell.Value
 .Cells(i, 5).Value = mycell.Comment.text
 End With
 Next mycell
 End If
 Set commrange = Nothing
 Next ws
 
 'format cells for no wrapping, remove line break
 newwks.Cells.WrapText = False
 newwks.Columns("E:E").Replace What:=Chr(10), _
 Replacement:=" ", LookAt:=xlPart, _
 SearchOrder:=xlByRows, MatchCase:=False, _
 SearchFormat:=False, ReplaceFormat:=False
 
 Application.ScreenUpdating = True
 
 End Sub

2. Open the Excel 2010 worksheet containing the data with comments.

ALSO READ:  How to Modify the Behavior of Enter Key in Excel

3. Press Alt + F11 to enter the Visual Basic Editor.

4. If necessary, press Ctrl + R to show the Project Explorer.

5. Right-click desired file on left (in bold).

6. Choose Insert -> Module.

7. Paste the code into the right pane.

8. Press Alt + Q to close the VBE.

9. Save the workbook in the XLSM format.

10. Select the Developer tab. (If you have a problem displaying the Developer tab, please read our post How to Activate the Developer Tab in Excel 2010.

11. On the Developer tab, in the Code group, click Macros.

12. In the Macro dialog box, select the macro and click Run. The comments in your datasheet will be extracted to a new sheet. You can then continue your analysis or other tasks associated with the extracted data.

Tweet
Share
WhatsApp
Pin
Buffer
0 Shares

Filed Under: How To Tagged With: excel how to, excel macros

You May Also Like

Ways to Use Excel Mobile - TATFI
10 Creative Ways to Use Excel Mobile in your Business
How to Get Rid of the Paste Options Menu in Word, Excel and PPT
How to Get Rid of the Paste Options Menu in Word, Excel and PPT
How to Calculate Number of Days Between Two Dates in Excel
How to Calculate Number of Days Between Two Dates in Excel

About Adeline Gear

Adeline is a tech enthusiast who loves exploring the latest tools and applications in the marketplace. She also loves her Android and spends time reviewing apps and playing games when she has the time.

Reader Interactions

Comments

  1. Mohd Akbar says

    December 16, 2011 at 5:35 pm

    I really appreciate your help with this. I will surely follow it, Thanks.

    Reply
  2. Ben says

    April 2, 2019 at 10:56 pm

    I followed this instruction and it exported only the first comment but not all the comment on the sheet. Is there something I am missing? I would be grateful if anyone can help.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Hottest New Gadgets!

Best e Readers to Buy in 2023 - TATFI

5 Best eReaders to Buy in 2023

Amazfit Falcon Smartwatch - TATFI

The Amazfit Falcon is a Military Grade Smartwatch with Premium Looks and Great Features

Couchmaster Cyboss Ergonomic Couch Desk - TATFI

Couchmaster Cyboss is an Ergonomic Desk to Keep Off Neck Pain

Philips Hue Festavia String Lights - TATFI

Add a Bit of Sparkle to Your Christmas Tree with Philips Hue Festavia String Lights

Samsung Galaxy Tab A7 Lite Kids Edition - TATFI

This Kid Friendly Tablet from AT&T is a Thoughtful Gift for Your Little One This Christmas

Is An iPhone Really Worth It - TATFI

Is an iPhone is Really Worth It?

Devices You Might Want to Try - TATFI

4 Fantastic Devices You Might Want to Try

Popular Tags

android android apps android games android how to apple casino games chrome extensions excel excel how to facebook gadgets gaming gmail google instagram ios apps ios games ios how to ios tips ipad iphone kids apps learn excel management microsoft music apps new releases outlook how to photo apps powerpoint powerpoint how to productivity Samsung security smartphone smartphones software tablet tablets twitter web browsers windows 10 word how to xbox youtube

Disclosure

TheAppTimes is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
Samsung Galaxy S10 Unlocked - TATFI

The Samsung Galaxy S10 Unlocked– Your Key to Total Freedom

Make Money Playing at Fairspin Online Casino - TATFI

Make Money Playing at Fairspin Online Casino

How Mobile Wellbeing Apps are Empowering Patients - TATFI

How Mobile Wellbeing Apps are Empowering Patients

Tips to Boost Your Ranking and Sales on Etsy - TATFI

5 Ways to Boost Your Ranking and Sales on Etsy

PunchBee Time Management App - TATFI

Know How You Spend Your Time with PunchBee

DevOps Model Explained - TATFI

The Complete Guide to DevOps: How the Model Works and Who It Benefits

Approaches to Digital Marketing - TATFI

Blending Technical and Content-Centric Approaches to Digital Marketing

Tech Tips For Startups - TATFI

Useful Tech Tips For Startups

Boox Tab X Android eReader - TATFI

Boox Tab X is an Android eReader That Helps You Do More Than Just Read

Best Translation Apps for Android - TATFI

5 Great Translation Apps for Android

Dynamic Island Feature on Your Android - TATFI

How to Get the Dynamic Island Feature on Android

Connected TV Advertising In 2023 - TATFI

5 Things You Need To Know About Connected TV Advertising In 2023

TheAppTimes © 2023 // Runs on StudioPress