Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to copy sum of selected cells only in Excel?

For example you have a range of number cells in Excel, and now you need to copy this range’s sum and paste into another cell, how could you handle it quickly? This article will share some easy workarounds to copy the sum of selected cells only in Excel.

Copy sum of selected cells only with VBA

Copy sum of selected cells only with creating a name range

Copy sum of selected cells only with ignoring hidden cells/rows/columns

Easily copy subtotals only from selection to another range or worksheet in Excel

With Kutools for Excel’s Advanced Combine Rows feature, Excel users can quickly calculate the subtotals (sum, count, average, etc.) without moving same items together. Therefore, you can copy your selection to the destination range, and then apply this feature for copying subtotals only in Excel. Full Feature Free Trial 30-day!

ad advanced combine rows copy subtotals

Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

We can apply a VBA to copy the sum of selected cells only and then paste into another cell in Excel. Please do as follows:

1. Select the number cells whose sum you will copy only, and press the Alt + F11 keys to open Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and then paste below VBA code into the opening Module window.

VBA: Copy sum of selected cells only in Excel

Sub CopySum()
Dim xOb As New DataObject
xOb.Clear
xOb.SetText Application.WorksheetFunction.Sum(Application.ActiveWindow.RangeSelection)
xOb.PutInClipboard
MsgBox "The sum of selected cells has been copied to the Clipboard.", vbInformation, "Kutools for Excel"
End Sub
3. Click Tools > References to open the References – VBAProject window.

4. In the References - VBAProject dialog box, please click the Browse button. Next select the FM20.DLL file in the folder of C:\Windows\System32 in the popping up Add Reference dialog box, and then click the Open button and OK button successively to close two dialog boxes. See screenshot:

Note: If the Microsoft Forms 2.0 Object Library option exists in the Available References box of References – VBAProject window, please check this option directly, and then click the OK button.

5. Now you return to the Module window, please press the F5 key or the Run button to run this VBA code.

And now a dialog box comes out and tell you the sum of selected cells has been copied to the Clipboard already. Please click the OK button to close it.

6. Go ahead to select the destination cell you will paste the sum into, and press the Ctrl + V keys simultaneously to paste the sum of selected cells.


Some Excel users may be reluctant to use the VBA code. Do not worry! This method will help you to copy the sum of selected cells only with creating a name range and applying the SUM function.

1. Select the range of cells whose sum you will copy, type a name in the Name box at the upper-left corner, and press the Enter key.

In our case, we define the name range as copy_sum in the Name box. See screenshot:

2. Select the destination cell you will paste the sum of these cells, type the formula =SUM(copy_sum) into it, and press the Enter key.

And now the sum of all cells in the name range returns in the selected cell.

Kutools for Excel’s To Actual: One click to remove formulas but keep calculated values from cells


Sometimes, there may be hidden cells, rows, or columns in the selected range whose sum you will copy. And you need to copy the sum ignoring any hidden cells, rows, and columns. How? Try this method!

1. Select the range with hidden rows and columns whose sum you will copy, type a name in the Name box at the upper-left corner, and press the Enter key. See screenshot:
In our case, we define the name range as copy_sum_visible in the Name box. See screenshot:

2. Select the destination cell you will place the sum at, and type the formula =SUMVISIBLE(copy_sum_visible) into it, and press the Enter key.

Notes:

(1) The SUMVISIBLE function is one of multiple useful built-in functions provided by Kutools for Excel.

(2) The sum value will become error if you send this workbook to others who don't install this Kutools for Excel. For the sake of avoiding this problem, we recommend you to replace the formula with its calculated value by Kutools for Excel's To Actual utility. Full Feature Free Trial 30-day!


Kutools for Excel includes more than 300 handy tools for Excel, free to try without limitation in 30 days. Download and Free Trial Now!


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
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.

Be the first to comment.