提示:其他語言是Google翻譯的。 你可以訪問 English 版本。
登入
x
or
x
x
註冊
x

or

在Excel中使用Ctrl + V時如何將粘貼值設置為默認粘貼?

通常,在Excel中,當您從一個範圍或工作表中復制數據並使用Ctrl + V粘貼到另一個時,格式化也將默認粘貼。 但是,有時候,當您粘貼數據時,您只想將數據粘貼為沒有任何格式的值。 在這裡,我可以為您介紹一種簡單的方法,只需在Excel中使用Ctrl + V時將粘貼值設置為默認粘貼。

使用帶VBA代碼的Ctrl + V時,將粘貼值設置為默認粘貼


複製多個範圍並一次粘貼到任何位置:

通常,Excel不支持多個副本,但是,如果有 Kutools for Excel,其 複製範圍 功能,您可以快速復制多個選定範圍,並根據需要將其粘貼到任何其他位置。

doc刪除所有選定的11

Kutools for Excel:比200方便的Excel加載項,可以在60天免費試用。 下載並免費試用現在!


使用帶VBA代碼的Ctrl + V時,將粘貼值設置為默認粘貼


如果僅將數據粘貼為值,則需要單擊所選內容的角落處的小方塊,並在每次粘貼數據後選擇“值”選項。 以下VBA代碼可以幫助您將默認粘貼更改為粘貼值。

1。 按住 ALT + F11 鍵打開 Microsoft Visual Basic for Applications窗口.

2。 點擊 插入 > 模塊,並將以下代碼粘貼到 模塊 窗口。

VBA代碼:使用Ctrl + V時,將粘貼值設置為默認粘貼

Sub PasteasValue()
Selection.PasteSpecial Paste:=xlPasteValues
End Sub

3。 然後保存並關閉代碼,然後按 Alt + F8鍵 鍵打開 對話框。

4。 在 對話框中,選擇使用的宏名稱 PasteasValue 然後單擊 選項 按鈕,看截圖:

文檔粘貼值,默認1

5。 然後在 宏選項 對話框下 快捷鍵 部分,請輸入 v ,看截圖:

文檔粘貼值,默認2

6。 然後點擊 OK 關閉 宏選項 對話框,並繼續關閉 對話。

現在,當你粘貼數據 按Ctrl + V,數據將默認粘貼為值。


相關文章:

如何將外部內容粘貼到Excel始終匹配目標格式?


演示:在Excel中使用Ctrl + V時,將粘貼值設置為默認粘貼

Kutools for Excel:比200方便的Excel加載項,可以在60天免費試用。 下載並免費試用現在!


Kutools for Excel解決了您的大多數問題,並使您的生產率提高了80%

  • 重用: 快速插入 複雜的公式,圖表 以及你以前用過的任何東西; 加密單元格 密碼; 創建郵件列表 並發送電子郵件...
  • 超級方程式酒吧 (輕鬆編輯多行文字和公式); 閱讀佈局 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
  • 合併單元格/行/列 不丟失數據; 分裂細胞含量; 組合重複的行/列...防止重複的細胞; 比較範圍...
  • 選擇複製或唯一 行; 選擇空行 (所有細胞都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇......
  • 精確複製 多個單元格而不更改公式參考; 自動創建參考 多張表; 插入項目符號,複選框等等......
  • 提取文本,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
  • 超級過濾器 (將過濾方案保存並應用到其他工作表); 高級排序 按月/週/日,頻率等; 特殊過濾器 用粗體,斜體......
  • 結合工作簿和工作表; 根據鍵列合併表; 將數據拆分為多個表格; 批量轉換xls,xlsx和PDF...
  • 超過300強大的功能。 支持Office / Excel 2007-2019和365。 支持所有語言。 在您的企業或組織中輕鬆部署。 全功能30天免費試用。
kte tab 201905

Office選項卡為Office提供選項卡式界面,使您的工作更輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,Publisher,Access,Visio和Project。
  • 在同一窗口的新選項卡中打開並創建多個文檔,而不是在新窗口中。
  • 通過50%提高您的工作效率,每天為您減少數百次鼠標點擊!
官方底部
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    loki · 2 months ago
    Saved module - called "module 2" but nothing shows up in macros - no 'PasteasValue'. Seems like a step is missing?
  • To post as a guest, your comment is unpublished.
    Hakan · 4 months ago
    I want to learn if there is a way to work in a sheet, not in a module.

    If not, is there a way to work in particular sheet I determine?
  • To post as a guest, your comment is unpublished.
    Deyaa El Morsy · 7 months ago
    It is working but after pasting you cannot undo
    • To post as a guest, your comment is unpublished.
      Pankaj kumar · 5 months ago
      Same here.
      • To post as a guest, your comment is unpublished.
        skyyang · 5 months ago
        Hello, guys,
        I am sorry, may be there is no other good way for solving this problem, if you have any other good ideas, please comment here.
        Thank you!
        • To post as a guest, your comment is unpublished.
          fuat · 5 months ago
          Save as binary .xlsb,
          Then you can use ctrl+z with macros.
  • To post as a guest, your comment is unpublished.
    Ross Brown · 1 years ago
    I agree Graham, just tried this in Excel 2016. When I click the Run button in the Macro dialog, I get the error message:

    Run-tme error '1004':
    PasteSpecial method of Range class failed

    which is a shame as this really would have helped me today. I also tried Dejvid's macro below, but nothing happened when pasting from one book to another.
    • To post as a guest, your comment is unpublished.
      Benj · 8 months ago
      Make sure you have something selected in copy mode. dont even bother entering his code
  • To post as a guest, your comment is unpublished.
    Graham Gibby · 1 years ago
    Unless I missed something (and the instructions are *very* good), this does not work in Excel 2016.
    • To post as a guest, your comment is unpublished.
      fuat · 5 months ago
      I use Microsoft office Standard 2016, at it works.
  • To post as a guest, your comment is unpublished.
    Tuhin Paul · 1 years ago
    Thank You, Sir...
  • To post as a guest, your comment is unpublished.
    Dejvid · 2 years ago
    nice tip, but the macro should look like this, because the code above give you an error statement, if you push ctrl+v and you didn't previously select something with ctrl+c

    Sub PasteAsValues()
    On Error GoTo err_handler:
    Selection.PasteSpecial Paste:=xlPasteValues
    Exit Sub
    err_handler:
    End Sub
  • To post as a guest, your comment is unpublished.
    MNGREEN · 2 years ago
    The solution from Mikael seems to nice replicate the 2013 solution offered by this page in a 2016-Excel-friendly way. Unfortunately, it also replicates the inability to undo (through Ctrl-Z or other "undo" actions) a paste action while this macro is enabled.
    • To post as a guest, your comment is unpublished.
      Mikael Fangel · 2 years ago
      To get the undo function to work after you have use a macro is quite difficult unfortunately.

      Can't help you with that, sorry.
  • To post as a guest, your comment is unpublished.
    obelisk · 2 years ago
    Hi,

    solution works great but control+z not working after pasting :( . any additional help?
  • To post as a guest, your comment is unpublished.
    Jonafree · 2 years ago
    This coding does not work with the latest version of Excel 2016. Running the script gives an error code for the line Paste:=xlPasteValues
    • To post as a guest, your comment is unpublished.
      Mikael Fangel · 2 years ago
      Try using this code with Excel 2016:

      Sub Paste_Special()
      Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
      :=False, Transpose:=False
      Application.CutCopyMode = False
      End Sub
      • To post as a guest, your comment is unpublished.
        JONAFREE · 2 years ago
        Thanks Mikael, but your code didn't work. Microsoft must have changed the VBA coding language too much in their last update. Even the text "Paste:=" results in a compiling error. If there's an answer out there, it must be in a different generation of Excel VBA.
        • To post as a guest, your comment is unpublished.
          Mikael Fangel · 2 years ago
          The macro i sent is recorded in the latest version of MS Excel 2016, so maybe the problem lies within your installation?

          Besides that the sub I wrote won't work without the "Selection.PasteSpecial" part.
    • To post as a guest, your comment is unpublished.
      L · 2 years ago
      I just ran into the same problem.
  • To post as a guest, your comment is unpublished.
    mngreen · 3 years ago
    Very nice solution. This has been plaguing me for quite some time.

    Two observations ...

    1) Unsurprisingly some work environments restrict or prohibit the use (and, more particularly, the emailing/receipt) of macro-enabled documents. Is there a non-macro workaround?
    2) Ctrl+Z .... "Undo" will not reverse a "paste" made using this macro. Is there a workaround or additional code that would permit/enable/create "undo" for pastes made with the macro?

    Thanks greatly.
  • To post as a guest, your comment is unpublished.
    Soundarya b · 3 years ago
    Thank you so much :D helped a lot!