ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Converting cell content into comment (https://www.excelbanter.com/excel-discussion-misc-queries/156855-converting-cell-content-into-comment.html)

Akash Maheshwari

Converting cell content into comment
 
Hi,

I have a sheet in which Leave is mentioned many times in different
cell. I want to have a macro through which i can replace the word
Leave and put a Comment with Leave in the cell How can i do that.

thanks in advance

Akash


JMB

Converting cell content into comment
 
http://www.cpearson.com/Excel/newposte.htm

Please read #21

If you multipost your question, pertinent details become fragmented across
multiple threads. Also, you will waste someones time trying to answer a
question that may have already been answered in another thread (which is why
a number of folks don't respond to multiposted questions).



"Akash Maheshwari" wrote:

Hi,

I have a sheet in which Leave is mentioned many times in different
cell. I want to have a macro through which i can replace the word
Leave and put a Comment with Leave in the cell How can i do that.

thanks in advance

Akash



Boris[_2_]

Converting cell content into comment
 
On Tue, 04 Sep 2007 05:36:21 -0000, Akash Maheshwari wrote:

Hi,

I have a sheet in which Leave is mentioned many times in different
cell. I want to have a macro through which i can replace the word
Leave and put a Comment with Leave in the cell How can i do that.

thanks in advance

Akash


Akash,

try with this code:
---
Sub DoComment()
Dim R As Range, rF As Range, cFirst As String

Set R = ActiveSheet.UsedRange.Find("Leave", _
LookIn:=xlValues, _
LookAt:=xlPart, _
MatchCase:=False)
If Not R Is Nothing Then
cFirst = R.Address
Do
R.AddComment "Leave in cell"
Set R = ActiveSheet.UsedRange.FindNext(R)
Loop Until R Is Nothing Or R.Address = cFirst
End If
End Sub
---

HTH,
B.


All times are GMT +1. The time now is 07:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com