ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel doesn't allow comments to be copied (https://www.excelbanter.com/excel-programming/312133-excel-doesnt-allow-comments-copied.html)

mike

Excel doesn't allow comments to be copied
 
Hi,
I'm in a big confusion and I need help!

In a VBA application in Excel I wrote some statement like
this:
"fromRange.Copy
toRange.PasteSpecial Paste:=xlPasteComments"
where, as you probably guessed, "fromRange" and "toRange"
are range objects.
Unfortunately, časte instruction doesn't work. The
comments, defined in "fromRange", aren't copied
into "toRange" as I expect.

Could someone help me to solve this mistery?

Thank you in advance!
Mike


Erik BZ

Excel doesn't allow comments to be copied
 
Hi, it works for me with this code:

Sub Test()

Dim fromRange, toRange As Range

Set fromRange = ActiveWorkbook.Sheets(1).Range("A1:C1")
Set toRange = ActiveWorkbook.Sheets(2).Range("A1")

fromRange.Copy
toRange.PasteSpecial Paste:=xlPasteComments

End Sub

Best reg.
Erik B


"mike" wrote in message
...
Hi,
I'm in a big confusion and I need help!

In a VBA application in Excel I wrote some statement like
this:
"fromRange.Copy
toRange.PasteSpecial Paste:=xlPasteComments"
where, as you probably guessed, "fromRange" and "toRange"
are range objects.
Unfortunately, časte instruction doesn't work. The
comments, defined in "fromRange", aren't copied
into "toRange" as I expect.

Could someone help me to solve this mistery?

Thank you in advance!
Mike



mike

Excel doesn't allow comments to be copied
 
Thanks Erik!
I agree, is functional also for me in a new workbook.
Still, it doesn't work in that old one.
I don't know, maybe something happened with this last wb.
Or, maybe, there is a setting which can deactivate this or
is a bug of excel ... who can know?
Do you have any ideea, what could gone wrong?
Mike


mike

Excel doesn't allow comments to be copied
 
Thanks Erik!
I've got it!!!

In a protected sheet, in an unprotected cell you cannot
copy a comment from another cell (even though destination
cell is UNPROTECTED and you have access to selecting it),
in another sheet. Stupid, isn't it?

Thanks again!
Mike

-----Original Message-----
Hi, it works for me with this code:

Sub Test()

Dim fromRange, toRange As Range

Set fromRange = ActiveWorkbook.Sheets(1).Range("A1:C1")
Set toRange = ActiveWorkbook.Sheets(2).Range("A1")

fromRange.Copy
toRange.PasteSpecial Paste:=xlPasteComments

End Sub

Best reg.
Erik B


"mike" wrote in

message
...
Hi,
I'm in a big confusion and I need help!

In a VBA application in Excel I wrote some statement like
this:
"fromRange.Copy
toRange.PasteSpecial Paste:=xlPasteComments"
where, as you probably guessed, "fromRange" and "toRange"
are range objects.
Unfortunately, časte instruction doesn't work. The
comments, defined in "fromRange", aren't copied
into "toRange" as I expect.

Could someone help me to solve this mistery?

Thank you in advance!
Mike


.



All times are GMT +1. The time now is 08:53 AM.

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