VBA For Filtering Comments in a Column

mayoung

Active Member
Joined
Mar 26, 2014
Messages
259
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I am using Office 365 excel Is there away to filter Comments NOT Notes in a Column? Can be using a helper column if necessary.
I have the ability to filter Notes in a column but want to filter Comments.
Any help would be appreciated.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
By filter do you mean show only rows where a particular comment exists in a cell? Or highlight the row? Or select the row?
If it involves multiple non-contiguous rows being selected, that's not something I've done - yet.
If you want a formula, I can't help with that but I think something can be done via code. Just not sure what that something is at the moment.
 
Upvote 0
This macro extracts every comment in column A and writes them to column C

VBA Code:
Sub jec()
 Dim it, x As Long
 With Range("A2", Range("A" & Rows.Count).End(xlUp))
    ReDim ar(.Rows.Count, 0)
    For Each it In .Cells
       If Not it.CommentThreaded Is Nothing Then
         ar(x, 0) = it.CommentThreaded.Text
         x = x + 1
       End If
    Next
    Range("C2").Resize(x) = ar
  End With
End Sub
 
Upvote 0
By filter do you mean show only rows where a particular comment exists in a cell? Or highlight the row? Or select the row?
If it involves multiple non-contiguous rows being selected, that's not something I've done - yet.
If you want a formula, I can't help with that but I think something can be done via code. Just not sure what that something is at the moment.
Correct I am wanting to filter to show only rows that contain Comments (Not Notes) using a Macro.
 
Upvote 0
Gotta run out. Will see where this went when I get back.
 
Upvote 0
For filtering as desired (column A in this example)

VBA Code:
Sub jec()
 Dim it, sp
 Set sp = Cells(99999, 1)
 
 For Each it In Range("A2", Range("A" & Rows.Count).End(xlUp))
    If it.CommentThreaded Is Nothing Then Set sp = Union(sp, it)
 Next

 sp.EntireRow.Hidden = True
End Sub
 
Upvote 0
In Excel you have the option to add a Comment or Note..What I am wanting to filter is the rows with Comments.
Any suggestions?


FA657A85-4153-4DAF-B35D-2AC0D036BB10.jpeg
 
Upvote 0
Did you even try the codes?
It is only possible with VBA
 
Upvote 0
But my codes both work for comments.
Do the cells have purple corners?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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