Clear comments from a range of cells

Damo10

Active Member
Joined
Dec 13, 2010
Messages
460
Hi,

I am trying to clear the comments from a range of cells without much luck, can anyone offer some advice?

c.Offset(, 8).Resize(, 108).ClearComments

Regards,
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
HAve you tried referencing the range, eg...

Code:
Sub MM1()
Range("A1:A10").ClearComments
End Sub
 
Upvote 0
Hi,

I have tried that but the comments don't delete from range.

the actual columns to delete the comments from are J:DM but the row will always be different.

Regards,
 
Upvote 0
So, are you saying you want to remove comments from any / all rows in cols J:DM ??
 
Upvote 0
I would like the comments to be deleted from cols J:DM but only for the selected row which is found via vba which is c.Offset(, 8).Resize(, 108).
 
Upvote 0
Your not explaining what "c" is
For some reason your only providing part of your script.



I would like the comments to be deleted from cols J:DM but only for the selected row which is found via vba which is c.Offset(, 8).Resize(, 108).
 
Upvote 0
Code:
Private Sub btnSave_Click()
Dim res As VbMsgBoxResult
Dim Rng As Range
Dim c As Range
res = MsgBox("Are you sure you want to delete employee" & vbLf & vbLf & Me.cboEmp.Column(0) & vbLf & "Employee number " & Me.cboEmp.Column(1) & "?", vbYesNo, "Deletion Check")
If res = vbNo Then Exit Sub
Set Rng = Sheet1.Range(Sheet1.Range("B8"), Sheet1.Range("B" & Rows.Count).End(xlUp))
For Each c In Rng
    
    If c.Text = Me.cboEmp.Text And c.Offset(, 1).Text = Me.txtEmpNo Then
        c.Resize(, 3).ClearContents
        c.Offset(, 8).Resize(, 108).ClearContents
    End If
Next c
Call SortAddBlankRows
ActiveWorkbook.Save
Unload Me
End Sub
 
Upvote 0
In post #1 you said:
c.Offset(, 8).Resize(, 108).ClearComments

In post #8 you said:
c.Offset(, 8).Resize(, 108).ClearContents


So what is it?

Are we clearing "Contents" or "Comments"

There is a differents.
 
Upvote 0
I am trying to do both.

Post 1 is what I tried and it didn't work this line was added after the ClearContents line and post 8 is the current code
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,593
Members
452,654
Latest member
mememe101

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