# Copying a cells contents from one sheet and pasting as comment in another sheet's cell

#### jmkelly1988

##### New Member
The following code works for copying and pasting, but not for copying then pasting as comments on another sheet. Can anyone help?
Code:
`````` Dim mainWS As Worksheet, copyWS As Worksheet, fmAry As Variant, toAry As Variant, lr As Long, x As Long, main2WS As Worksheet, copy2WS As Worksheet, z As Long, fm2Ary As Variant, to2Ary As Variant

Set mainWS = Worksheets("Programmer")
Set copyWS = Worksheets("WOD Calendar")
Set main2WS = Worksheets("Graph Input Data")
Set copy2WS = Worksheets("Graph Data")
With copyWS
If .Range("A3") = "" Then
lr = 3
x = lr
y = lr + 1
Else
lr = .Cells(Rows.Count, 2).End(xlUp).Row
End If
If lr > 3 Then
x = lr + 2
End If
End With
fmAry = Array("M26", "N26", "O26", "P26", "Q26", "R26", "S26")
toAry = Array("F" & x, "L" & x, "R" & x, "X" & x, "AD" & x, "AJ" & x, "AP" & x)
For j = LBound(fmAry) To UBound(fmAry)
mainWS.Range(fmAry(j)).Copy
copyWS.Range(toAry(j)).PasteSpecial xlPasteComment
Next``````

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### Snakehips

##### Well-known Member
jmkelly1988,

Try....
Code:
``````For j = LBound(fmAry) To UBound(fmAry)
On Error Resume Next
copyWS.Range(toAry(j)).AddComment
copyWS.Range(toAry(j)).Comment.Text Text:=mainWS.Range(fmAry(j)).Value
On Error GoTo 0
Next``````

Hope that helps.

Last edited:

#### jmkelly1988

##### New Member
This seems to be working perfectly. Thank you so so much!!!!

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Threads
1,167,991
Messages
5,856,689
Members
431,828
Latest member
kARTIK12345

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back