Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default macro to insert comment

Hi all - I've been looking for some sample code to do the following.

I'm looking for a macro that will first check if the cell in column E has
data; if it does, I want to cut the data (it will be txt) from the cell in
column E and insert it as a comment in column A, and do that for each row in
the worksheet. I looked through this site and Contextures and couldn't find a
sample.

Any help always appreciated!
Theo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default macro to insert comment

Dear Theo

Try the below macro

Sub Macro1()

Adjust the number of rows as per your requirement

For lngRow = 1 To 100
If Trim(Range("E" & lngRow)) < "" Then
Range("A" & lngRow).ClearComments
Range("A" & lngRow).AddComment Range("E" & lngRow).Text
Range("E" & lngRow) = ""
End If
Next

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Theo" wrote:

Hi all - I've been looking for some sample code to do the following.

I'm looking for a macro that will first check if the cell in column E has
data; if it does, I want to cut the data (it will be txt) from the cell in
column E and insert it as a comment in column A, and do that for each row in
the worksheet. I looked through this site and Contextures and couldn't find a
sample.

Any help always appreciated!
Theo

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default macro to insert comment

Thanks Jacob - that was short and sweet. Works great.
Theo

"Jacob Skaria" wrote:

Dear Theo

Try the below macro

Sub Macro1()

Adjust the number of rows as per your requirement

For lngRow = 1 To 100
If Trim(Range("E" & lngRow)) < "" Then
Range("A" & lngRow).ClearComments
Range("A" & lngRow).AddComment Range("E" & lngRow).Text
Range("E" & lngRow) = ""
End If
Next

End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Theo" wrote:

Hi all - I've been looking for some sample code to do the following.

I'm looking for a macro that will first check if the cell in column E has
data; if it does, I want to cut the data (it will be txt) from the cell in
column E and insert it as a comment in column A, and do that for each row in
the worksheet. I looked through this site and Contextures and couldn't find a
sample.

Any help always appreciated!
Theo

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro-insert text(personal comment) puiuluipui Excel Discussion (Misc queries) 2 September 24th 09 09:45 PM
macro to insert a comment driller Excel Worksheet Functions 0 February 8th 07 10:22 PM
having a macro insert a comment jhahes[_31_] Excel Programming 1 September 20th 05 10:37 PM
Macro to Insert Comment to a cell wojo Excel Programming 14 July 22nd 05 02:50 PM
Macro to Insert Comment to a cell wojo Excel Programming 0 July 21st 05 04:06 PM


All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"