Need advise on code

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,072
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
VBA Code:
Sub CopyComments()
Dim W As Workbook, W1 As Workbook, Sh As Worksheet, Sh1 As Worksheet
    Set W = Workbooks("Workbook1.xlsx")
    Set W1 = Workbooks("Workbook2.xlsx")
      Set Sh = W.Worksheets("HR&Finance")
      Set Sh1 = W1.Worksheets("Budget")

      Sh.UsedRange.Copy

      W1.Activate: Sh1.Activate
      Sh1.Range("A1").PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _
                                        SkipBlanks:=False, Transpose:=False
      Application.CutCopyMode = False
End Sub
Found this on line and It may do just what I want - copy a comment from one workbook to another.
But I'm a bit wary - what comment is affected? I don't want to do all just some of them, one at a time.
And do I want SkipBlanks, Transpose etc as shown?
Any help appreciated,
 
You've got it.
Everything on the sheet - YES
Every Note AND Comment - YES
For 1 Note/Comment in 1 Cell - YES specify that Range/Cell as the source
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,837
Messages
6,174,927
Members
452,592
Latest member
Welshy1491

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

Which adblocker are you using?

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
Back
Top