ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   reading comments value into a string variable (https://www.excelbanter.com/excel-programming/346005-reading-comments-value-into-string-variable.html)

Matilda

reading comments value into a string variable
 
Can't find anywhere the syntax for reading a comment into a variable in order
to write it to another cell.
cmnt = ActiveCell.comment.Text
produces error msg
- object variable orWith block not set

Many TIA'S in advance

Matilda

Dave Peterson

reading comments value into a string variable
 
Check for a comment first.

if activecell.comment is nothing then
'do nothing
'cmnt = ""
'whatever you want
else
cmnt = activecell.comment.text
end if



Matilda wrote:

Can't find anywhere the syntax for reading a comment into a variable in order
to write it to another cell.
cmnt = ActiveCell.comment.Text
produces error msg
- object variable orWith block not set

Many TIA'S in advance

Matilda


--

Dave Peterson

Matilda

reading comments value into a string variable
 

Thanks for coming to the rescue again, Dave

Matilda x
"Dave Peterson" wrote:

Check for a comment first.

if activecell.comment is nothing then
'do nothing
'cmnt = ""
'whatever you want
else
cmnt = activecell.comment.text
end if



Matilda wrote:

Can't find anywhere the syntax for reading a comment into a variable in order
to write it to another cell.
cmnt = ActiveCell.comment.Text
produces error msg
- object variable orWith block not set

Many TIA'S in advance

Matilda


--

Dave Peterson



All times are GMT +1. The time now is 05:06 PM.

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