Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Help with reading comments.

Try adding "On Error Resume Next" to your code that's
getting runtime error 91. If you are using a loop you
need to declare an array variable to store multiple
comments. Instead of assigning the comments to an array I
would just assign them to another cell. See example below.

For i = 1 To ActiveSheet.UsedRange.Rows.Count
If Cells(i, "A").Comment.Text < "" Then Cells(i, "B") =
Cells(i, "A").Comment.Text
Next

Hope this helps... Al

-----Original Message-----
Hi, I need some help with comments. Specifically, I'm

trying to write a macro that needs to test to see if a
cell has a comment, and if so, store the contents of that
comment in a string variable. I think I can figure the
rest out on my own, but every time I try something like:

myComment = Range(myCurrentCell).Comment.Text

I get an runtime error 91. It's very annoying. I've

noticed that

myComment = Range("A1").Comment.Text

works just fine, it just doesn't like the variable in the

range. MyCurrentCell is in a For/Next Loop and get's its'
value from the line:

myCurrentCell = c.Address([False], [False])

I've used similar things in all sorts of other macros,

so... I'm stumped.

Thanks for your help.
.

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
excel 2000 how to format the comments font all comments Delquestion Excel Discussion (Misc queries) 1 October 8th 09 02:19 PM
Reading XML Ajit Excel Discussion (Misc queries) 1 October 2nd 07 10:54 PM
in excel useing comments how do you add clip art to comments? dhouse New Users to Excel 2 July 18th 07 08:14 AM
reading xls from asp mrweb Excel Programming 0 October 20th 03 08:54 PM
sub for reading Fernando Duran Excel Programming 4 September 15th 03 07:52 PM


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

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

About Us

"It's about Microsoft Excel"