View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default VBA - Passing Cell Contents Into Comment

Hi Tony,

Try, instead:

Public Sub Tester02()
Dim rng1 As Range, rng2 As Range
Dim sStr As String
Dim sh As Worksheet

Set sh = ActiveSheet '<<======= CHANGE
Set rng1 = sh.Range("A1") '<<======= CHANGE
Set rng2 = sh.Range("B1") '<<======= CHANGE

sStr = rng1.Text

With rng2
If .Comment Is Nothing Then .AddComment
.Comment.Text Text:=sStr
End With

End Sub


---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Tony,

Try something like:

Public Sub Tester02()
Dim rng1 As Range, rng2 As Range
Dim sStr As String
Dim sh As Worksheet

Set sh = ActiveSheet '<<======= CHANGE
Set rng1 = sh.Range("A1") '<<======= CHANGE
Set rng2 = sh.Range("B1") '<<======= CHANGE

sStr = rng1.Text

With rng2
If rng2.Comment Is Nothing Then
.AddComment
.Comment.Text Text:=sStr
End If
End With

End Sub


---
Regards,
Norman



"ajocius" wrote in
message ...

Group,
Is it possible to pass the contents of a cell into a comment in
another cell? If so, how can I do this? Thank you for your
assistance.

Tony


--
ajocius
------------------------------------------------------------------------
ajocius's Profile:
http://www.excelforum.com/member.php...o&userid=17695
View this thread:
http://www.excelforum.com/showthread...hreadid=391261