Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Comment Import

Mark,

Thank you for your answer.
So, I can import comments also programmatically.
But I want to ask you, whether you know a tool to do this ?
Otherwise, I have to be bothered with it since I did not write code
for excel.

Thank You
Omur Olmez


  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Comment Import

Another way is to just use the cells with comments:

Option Explicit
Sub testme()
Dim myCell As Range
Dim myRng As Range

With Worksheets("sheet1")
Set myRng = Nothing
On Error Resume Next
Set myRng = .Range("c:c").Cells.SpecialCells(xlCellTypeComment s)
On Error GoTo 0

If myRng Is Nothing Then
'do nothing--no comments
Else
For Each myCell In myRng.Cells
myCell.Offset(0, 5).Value = myCell.Comment.Text
Next myCell
End If
End With

End Sub

Or you could go through the comment collection:

Sub testme02()

Dim myComment As Comment

With Worksheets("sheet1")
For Each myComment In .Comments
If myComment.Parent.Column = 3 Then
myComment.Parent.Offset(0, 5).Value = myComment.Text
End If
Next myComment
End With

End Sub


"Ömür Ölmez" wrote:

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


--

Dave Peterson

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
import XML data...Is there a size limit on the import? MatthewG Excel Discussion (Misc queries) 0 February 10th 09 05:57 PM
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
copy comment content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
How can I edit a comment w/o first having to select Show Comment Mary Ann Excel Discussion (Misc queries) 1 August 26th 05 12:34 AM
a comment plugin & copy paste directly from excel to comment ? fr. RFM Excel Worksheet Functions 0 December 1st 04 11:29 PM


All times are GMT +1. The time now is 06:31 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"