Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Copying comments from one cell to another

Is there a VB way to copy the comments from a cell in one
workbook and attach them to a cell in a second workbook?

Wayne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying comments from one cell to another

workbooks("Book2.xls").Worksheets(2).Range("B9").N oteText Text:= _
Workbooks("Book1.xls").Worksheets(1).Range("A5").N oteText

See help on notetext if the length is greater than 255
--
Regards,
Tom Ogilvy


"Wayne" wrote in message
...
Is there a VB way to copy the comments from a cell in one
workbook and attach them to a cell in a second workbook?

Wayne



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Copying comments from one cell to another

Thanks Tom! Looks like about 95% of what i'll need.

I'd like to do this throughout a range of cells. Here is
the code I'm using to step through the range to color the
backgound. Each cell contains a paste link reference to
the source file. I'm hoping I can include code like yours
as part of the "For each cell in range" loop:

Sub UpdateStoplights()
Application.ScreenUpdating = False
Range("stoplights").Select
Dim Cel As Range
Dim val As Integer
For Each Cel In Range("stoplights")
val = Cel.Value
Select Case val
Case 1
Cel.Interior.ColorIndex = 3
Cel.Font.ColorIndex = 3
Case 2
Cel.Interior.ColorIndex = 6
Cel.Font.ColorIndex = 6
Case 3
Cel.Interior.ColorIndex = 4
Cel.Font.ColorIndex = 4
Case 4
Cel.Interior.ColorIndex = 5
Cel.Font.ColorIndex = 5
Case Else
Cel.Interior.ColorIndex = 2
Cel.Font.ColorIndex = 2
End Select
Next

Thanks again.

Wayne

-----Original Message-----
workbooks("Book2.xls").Worksheets(2).Range

("B9").NoteText Text:= _
Workbooks("Book1.xls").Worksheets(1).Range

("A5").NoteText

See help on notetext if the length is greater than 255
--
Regards,
Tom Ogilvy


"Wayne" wrote in

message
...
Is there a VB way to copy the comments from a cell in

one
workbook and attach them to a cell in a second

workbook?

Wayne



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying comments from one cell to another

Since you don't say where to put the comments, here is illustrative code:

Sub UpdateStoplights()
Application.ScreenUpdating = False
Range("stoplights").Select
Dim Cel As Range
Dim i as Long
Dim val As Integer
i = 1
For Each Cel In Range("stoplights")
workbooks("Book2.xls").Worksheets(2) _
.Range("B9")(i).NoteText Text:= _
cel.NoteText
i = i + 1
val = Cel.Value
Select Case val
Case 1
Cel.Interior.ColorIndex = 3
Cel.Font.ColorIndex = 3
Case 2
Cel.Interior.ColorIndex = 6
Cel.Font.ColorIndex = 6
Case 3
Cel.Interior.ColorIndex = 4
Cel.Font.ColorIndex = 4
Case 4
Cel.Interior.ColorIndex = 5
Cel.Font.ColorIndex = 5
Case Else
Cel.Interior.ColorIndex = 2
Cel.Font.ColorIndex = 2
End Select
Next

--
Regards,
Tom Ogilvy


  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Copying comments from one cell to another

I need to copy them from a cell in a second worksheet,
the address of which is in the target cell as a Paste
link, e.g "\\FIL-NW02-06
\MPTTechTeamLeaders\8_Tech_Team_Scorecard\Reddy Team
Scorecards\[2005_Define_Scorecard_Hixson.xls"


So how might that work? Is there a way to get that
pathname and useit where you have the "Book.xls"
referrence for example?

Wayne

-----Original Message-----
Since you don't say where to put the comments, here is

illustrative code:

Sub UpdateStoplights()
Application.ScreenUpdating = False
Range("stoplights").Select
Dim Cel As Range
Dim i as Long
Dim val As Integer
i = 1
For Each Cel In Range("stoplights")
workbooks("Book2.xls").Worksheets(2) _
.Range("B9")(i).NoteText Text:= _
cel.NoteText
i = i + 1
val = Cel.Value
Select Case val
Case 1
Cel.Interior.ColorIndex = 3
Cel.Font.ColorIndex = 3
Case 2
Cel.Interior.ColorIndex = 6
Cel.Font.ColorIndex = 6
Case 3
Cel.Interior.ColorIndex = 4
Cel.Font.ColorIndex = 4
Case 4
Cel.Interior.ColorIndex = 5
Cel.Font.ColorIndex = 5
Case Else
Cel.Interior.ColorIndex = 2
Cel.Font.ColorIndex = 2
End Select
Next

--
Regards,
Tom Ogilvy


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Copying comments from one cell to another

You would have to open it

Dim bk as Workbook
set bk = workbooks.Open( Range(SomeCell).Value)

then
workbooks("Book2.xls").Worksheets(2) _
.Range("B9")(i).NoteText Text:= _
cel.NoteText

would be

bk.Worksheets(2) _
.Range("B9")(i).NoteText Text:= _
cel.NoteText
--
Regards,
Tom Ogilvy


wrote in message
...
I need to copy them from a cell in a second worksheet,
the address of which is in the target cell as a Paste
link, e.g "\\FIL-NW02-06
\MPTTechTeamLeaders\8_Tech_Team_Scorecard\Reddy Team
Scorecards\[2005_Define_Scorecard_Hixson.xls"


So how might that work? Is there a way to get that
pathname and useit where you have the "Book.xls"
referrence for example?

Wayne

-----Original Message-----
Since you don't say where to put the comments, here is

illustrative code:

Sub UpdateStoplights()
Application.ScreenUpdating = False
Range("stoplights").Select
Dim Cel As Range
Dim i as Long
Dim val As Integer
i = 1
For Each Cel In Range("stoplights")
workbooks("Book2.xls").Worksheets(2) _
.Range("B9")(i).NoteText Text:= _
cel.NoteText
i = i + 1
val = Cel.Value
Select Case val
Case 1
Cel.Interior.ColorIndex = 3
Cel.Font.ColorIndex = 3
Case 2
Cel.Interior.ColorIndex = 6
Cel.Font.ColorIndex = 6
Case 3
Cel.Interior.ColorIndex = 4
Cel.Font.ColorIndex = 4
Case 4
Cel.Interior.ColorIndex = 5
Cel.Font.ColorIndex = 5
Case Else
Cel.Interior.ColorIndex = 2
Cel.Font.ColorIndex = 2
End Select
Next

--
Regards,
Tom Ogilvy


.



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
Copying Comments Paul Calcagno Excel Discussion (Misc queries) 6 March 13th 09 03:43 PM
copying comments box chesjak Excel Worksheet Functions 1 October 23rd 08 12:42 PM
Copying comments from one cell to another, in a different spreadsheet =!CmOrE!= Excel Worksheet Functions 4 July 25th 06 01:39 AM
Q: copying comments JIM.H. Excel Discussion (Misc queries) 4 November 30th 05 10:03 PM
copying comments Jack Sons Excel Discussion (Misc queries) 2 November 29th 05 12:08 PM


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