View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ömür Ölmez Ömür Ölmez is offline
external usenet poster
 
Posts: 2
Default Comment Import

Hello
About this topic, an idea comes to my mind :
I will create an Excel VBA.
In an event, I'll add some code like this :
dim n as integer
for n=1 to LastRowNumber
Worksheets("Sheet1").Cells(n, 8).Value = _
Worksheets("Sheet1").Cells(n, 3).Comment.Text
next
What I want to do is retrieving comments into new cells. So, I can
easily import them by using SQL's tools.
But I have some problems about this method :
* How can I check if there is a comment in a specific cell. I want
to do this because, Error 91 occurs if there is no comment in the cell when
I try to retrieve it.
* How can I use the application/code on some other excel documents.
I wonder this because as I know, the VBA code is inserted directly into
working .xls file.

By the way, the Mark's code did not run :
strComment = Sheets(1).Cells(5, 3).Comment.Text
I use this code instead of Mark's :
Worksheets("Sheet1").Cells(n, 3).Comment.Text

Thank You For Your Helps
Omur Olmez