jmkelly1988
New Member
- Joined
- Dec 7, 2016
- Messages
- 19
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