[VBA] Overview comments

brambbob

New Member
Joined
Aug 25, 2017
Messages
2
Hi guys,

I found the following vba code online which creates an additional sheet with all comments in a table:
Sub ShowCommentsAllSheets()
Dim commrange As Range
Dim rng As Range
Dim ws As Worksheet
Dim newWs As Worksheet
Set newWs = Application.Worksheets.Add
newWs.Range("A1").Resize(1, 4).Value = Array("Sheet", "Address", "Value", "Comment")
Application.ScreenUpdating = False
On Error Resume Next
For Each ws In Application.ActiveWorkbook.Worksheets
Set commrange = ws.Cells.SpecialCells(xlCellTypeComments)
If Not commrange Is Nothing Then
i = newWs.Cells(Rows.Count, 1).End(xlUp).Row
For Each rng In commrange
i = i + 1
newWs.Cells(i, 1).Resize(1, 4).Value = Array(ws.Name, rng.Address, rng.Value, rng.Comment.Text)
Next
End If
Set commrange = Nothing
Next
newWs.Cells.WrapText = False
Application.ScreenUpdating = True
End Sub


I would like to tweak the code in order that it:

  1. Adds a column before the sheet column that is 1.1 for the first question in a specific sheet 1.2 for the second question in the same sheet, 2.1 for the first question in the next sheet etcetera.
  2. That the value colum is directly linked to the relevant cell, so that is easy to follow the table to specific comments.
  3. Bullit point 2 implies that I wouldn't need the Address column anymore.
  4. Nice-to-have would be an easy filter which filters on the person which made the comment.

Note:
I'm new to VBAs, it would be highly appreciated if someone could walk me through the code.
This is my first forum post, so please inform me if this post is not correctly formatted/in the correct place.

Kind regards,
Bram
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi brambbob,
This is my first forum post, so please inform me if this post is not correctly formatted/in the correct place.
When you poste a code then it would be better for helpers that you rap them in the code tags. Click Above # and place your code between those tags)

With your questions I am not to sure what exactly you try to do.. maybe someone else here has a better understanding and can help you.

Silentwolf
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top