ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy Text into comment box (https://www.excelbanter.com/excel-programming/423284-copy-text-into-comment-box.html)

Juan

Copy Text into comment box
 
Hi,
I'm trying to modify the macro below, but can't seem to get it.
Sub comnt()
Range("a2").Select
Dim tst As String
tst = ActiveCell.Value
'apply variable to the desired location
Range("d2").NoteText tst

Basically, some rows in range Z9:48 contain text, which I want to copy
into range Y9:Y48 as comment box.
The macro does work if I put Range("Z9").select Range(Y9").NoteText tst
Which will just do that row.

would appreciate any help.
Thank you,
Juan

Gary''s Student

Copy Text into comment box
 
Sub CaptureText()
Set r = Range("Z9:Z48")
For Each rr In r
rr.Offset(0, -1).NoteText rr.Value
Next
End Sub

--
Gary''s Student - gsnu200830

Juan

Copy Text into comment box
 
Gary
thank you so much for the quick reply. It works.

Juan

"Gary''s Student" wrote:

Sub CaptureText()
Set r = Range("Z9:Z48")
For Each rr In r
rr.Offset(0, -1).NoteText rr.Value
Next
End Sub

--
Gary''s Student - gsnu200830


Gary''s Student

Copy Text into comment box
 
You are very welcome!
--
Gary''s Student - gsnu200830


"Juan" wrote:

Gary
thank you so much for the quick reply. It works.

Juan

"Gary''s Student" wrote:

Sub CaptureText()
Set r = Range("Z9:Z48")
For Each rr In r
rr.Offset(0, -1).NoteText rr.Value
Next
End Sub

--
Gary''s Student - gsnu200830



All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com