Macro Info...

B_2

Board Regular
Joined
Aug 24, 2002
Messages
210
Is it possible for a macro to delete comments within specified cells?

such as A2 & B4


Regards
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Yes, for example: -

Range("A2,B4").ClearComments

Best way to find out about things like this is just to record yourself doing them and then edit the code to suit.
 
Upvote 0
Sub Clear_Contents()
Range("A2,B4").ClearContents
End Sub

did the trick..thx for the reply Mudface
 
Upvote 0
Hi B_2,

Just to clarify, the code that Mudface provided will clear any comments in a cell (ie comments added with 'Insert Comment' and leaving the telltale red triangle in top-right corner of the cell), which is what you asked for.

The code example that you provided clears the contents of the cell (ie normal data entry into a cell).

These are two different things, make sure you are using the method that will give the desired result :wink:.

_________________<font color="blue"> «««<font color="red">¤<font color="blue"><font size=+1>Richie</font><font color="red">¤<font color="blue"> »»»</font>

caffeine_sample.gif
</gif>
This message was edited by Richie(UK) on 2002-10-20 15:53
 
Upvote 0
Hi

Some what confused but try this
Highlight you cell and run this code from command buttion



Activecells.select
Selection.ClearComments

[A1].select

this will do as you ask,mif used as i have explained

Jack
 
Upvote 0
Just for fun if you want to remove ALL coments this might help you

Sub Jack_ClearComments()
For Each Jack In ActiveSheet.Comments
Jack.Delete
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,015
Members
449,060
Latest member
LinusJE

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