+ Reply to Thread
Results 1 to 3 of 3

Copy to Paste the Sum of the Selected VISIBLE Cells

  1. #1
    Registered User
    Join Date
    01-05-2016
    Location
    Chicago
    MS-Off Ver
    IL
    Posts
    13

    Copy to Paste the Sum of the Selected VISIBLE Cells

    Hello,

    I'm trying to finish a VBA macro so that I can copy/paste the sum of the selected visible cells.


    The code below:

    Sub mySum()
    Dim MyDataObj As New DataObject
    MyDataObj.SetText Application.Sum(Selection)
    MyDataObj.PutInClipboard
    End Sub

    However, this currently will sum ALL cells in the selected range, even filtered ones. What should I add to sum only the visible selected cells?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Copy to Paste the Sum of the Selected VISIBLE Cells

    Please Login or Register  to view this content.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Registered User
    Join Date
    01-05-2016
    Location
    Chicago
    MS-Off Ver
    IL
    Posts
    13

    Re: Copy to Paste the Sum of the Selected VISIBLE Cells

    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy/paste visible cells only?
    By Royser12345 in forum Excel General
    Replies: 3
    Last Post: 03-02-2014, 01:52 PM
  2. [SOLVED] VBA to copy visible cells only and paste to another worksheets
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2013, 09:35 AM
  3. [SOLVED] Copy and Paste Visible Cells Only to another Worksheet
    By excelnoob808 in forum Excel General
    Replies: 8
    Last Post: 05-30-2013, 03:28 PM
  4. Copy & Paste visible cells only
    By klopatios in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-06-2013, 03:59 AM
  5. copy data from selected cells , in selected row and paste it to ms word table ?
    By aaashaaa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2010, 03:25 PM
  6. Copy Visible cells and paste values only to visible target cells
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2010, 04:09 AM
  7. Copy and Paste Visible Cells
    By Lost and Looking for Help in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2006, 10:20 AM
  8. [SOLVED] Copy & Paste visible cells only
    By Scott in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1