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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
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.
 

B_2

Board Regular
Joined
Aug 24, 2002
Messages
210
Sub Clear_Contents()
Range("A2,B4").ClearContents
End Sub

did the trick..thx for the reply Mudface
 

Richie(UK)

MrExcel MVP
Joined
May 17, 2002
Messages
3,329
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
 

Jack in the UK

Well-known Member
Joined
Feb 16, 2002
Messages
3,215

ADVERTISEMENT

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
 

Jack in the UK

Well-known Member
Joined
Feb 16, 2002
Messages
3,215
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
 

Forum statistics

Threads
1,143,640
Messages
5,719,984
Members
422,256
Latest member
downeybm

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
Top