Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
import XML data...Is there a size limit on the import? | Excel Discussion (Misc queries) | |||
How to Start Excel in Text Import Wizard for data import | Setting up and Configuration of Excel | |||
copy comment content to cell content as data not as comment | Excel Discussion (Misc queries) | |||
How can I edit a comment w/o first having to select Show Comment | Excel Discussion (Misc queries) | |||
a comment plugin & copy paste directly from excel to comment ? fr. | Excel Worksheet Functions |