Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro-insert text(personal comment) | Excel Discussion (Misc queries) | |||
macro to insert a comment | Excel Worksheet Functions | |||
having a macro insert a comment | Excel Programming | |||
Macro to Insert Comment to a cell | Excel Programming | |||
Macro to Insert Comment to a cell | Excel Programming |