跳到主要內容

如何快速將註釋插入Excel中的多個單元格?

在工作表中,在單元格中插入評論非常容易,但是當您想將同一條評論同時插入多個單元格中時,該怎麼辦?

使用選擇性粘貼功能在多個單元格中插入註釋
使用VBA代碼在多個單元格中插入註釋


使用選擇性粘貼功能在多個單元格中插入註釋

在Excel中,無法同時插入多個註釋。 但是,您可以將註釋複製到多個單元格,如下所示:

1.在單元格中插入您的評論。

2.選擇註釋單元格,然後按 按Ctrl + C 鍵複製它。

3.然後選擇並右鍵單擊要批量插入註釋的範圍,選擇  選擇性粘貼 > 選擇性粘貼 從右鍵單擊菜單中。 看截圖:

4。 在裡面 選擇性粘貼 對話框,檢查 留言 選項,然後單擊 OK 按鈕。 看截圖:

然後,將相同的註釋立即插入所有選定的單元格。

備註:此方法會將相同的註釋插入所有選定的單元格。 如果僅在過濾列表的可見單元格中插入相同的註釋,請嘗試以下VBA方法。


使用VBA代碼在多個單元格中插入註釋

假設您有一個過濾列表,如下圖所示。 您只想向所有可見的單元格批量添加註釋。 請執行以下操作。

1。 按 其他 + F11 鑰匙一起打開 適用於應用程序的Microsoft Visual Basic 窗口。

2。 在裡面 Mocrosoft Visual Basic應用程序 窗口,請點擊 插入 > 模塊,然後將以下代碼輸入到模塊中:

VBA:對多個單元格進行批量惰性註釋(僅在過濾列表中可見單元格)

Sub InsertCommentsSelection()
    Dim xRg As Range
    Dim xRgEach As Range
    Dim xAddress As String
    Dim xText As String
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select a range:", "Kutools For Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    If xRg.Count > 1 Then
        Set xRg = xRg.SpecialCells(xlCellTypeVisible)
    End If
    xRg.Select
    xText = InputBox("Enter Comment to Add" & vbCrLf & "Comment will be added to all cells in Selection: ", "Kutools For Excel")
    If xText = "" Then
        MsgBox "No comment added", vbInformation, "Kutools For Excel"
        Exit Sub
    End If
    For Each xRgEach In xRg
        With xRgEach
        .ClearComments
        .AddComment
        .Comment.Text Text:=xText
        End With
    Next xRgEach
End Sub

3。 按 F5 鍵來運行代碼。 在第一個彈出 Excel的Kutools 對話框,請選擇要添加註釋的過濾範圍,然後單擊 OK 按鈕。 看截圖:

4.然後另一個 Excel的Kutools 對話框彈出,請在文本框中輸入您的評論,然後單擊 OK 按鈕。

現在,註釋僅插入到選定過濾列表中的所有可見單元格中,如下圖所示:


最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how do you make it ignores none merged cells and just add notes to only the merged cells selected?
This comment was minimized by the moderator on the site
Hello, iresolver
To solve your problem, please apply the below code:
Sub InsertCommentsSelection()
    Dim xRg As Range
    Dim xRgEach As Range
    Dim xAddress As String
    Dim xText As String
    On Error Resume Next
    xAddress = ActiveWindow.RangeSelection.Address
    Set xRg = Application.InputBox("Please select a range:", "Kutools For Excel", xAddress, , , , , 8)
    If xRg Is Nothing Then Exit Sub
    If xRg.Count > 1 Then
        Set xRg = xRg.SpecialCells(xlCellTypeVisible)
    End If
    xRg.Select
    xText = InputBox("Enter Comment to Add" & vbCrLf & "Comment will be added to all cells in Selection: ", "Kutools For Excel")
    If xText = "" Then
        MsgBox "No comment added", vbInformation, "Kutools For Excel"
        Exit Sub
    End If
    For Each xRgEach In xRg
        If xRgEach.MergeCells Then
            With xRgEach
            .ClearComments
            .AddComment
            .Comment.Text Text:=xText
            End With
        End If
    Next xRgEach
End Sub


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Excelente, gracias
This comment was minimized by the moderator on the site
Excelente aporte, gracias por el dato !!!!
This comment was minimized by the moderator on the site
Can anyone help me in VBA Code,
I want that I do multiple comments and have option to add picture in each cell without doing formatting again and again.
and then picture of that cell will save in folder of excel file with same cell name.
I will be thankful to you if anyone helps me in this
This comment was minimized by the moderator on the site
this is really very informative post ..


thanks for the awesome post
digifloor
This comment was minimized by the moderator on the site
for filtered cell it is not working
This comment was minimized by the moderator on the site
Dear me,
The VBA code is now updated. It supports batch insert comment to not only normal range, but also visible cells only in a filtered list.
Thank you for your comment!
This comment was minimized by the moderator on the site
if the sheet in excel is in filter will this apply for only filtered cells????
This comment was minimized by the moderator on the site
[quote]I researed valuable information on this point as I am working on a class project. Thank you posting useful information and its now becoming easier to accomplish this task. font converter online
This comment was minimized by the moderator on the site
That's really helpful. thanks.
This comment was minimized by the moderator on the site
This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog. Yong http://www.gofastek.com
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations