+ Reply to Thread
Results 1 to 11 of 11

Copy values of visible cells

  1. #1
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Copy values of visible cells

    Hi,
    I want to copy the values of visible cells in a table.
    I am using this:

    Please Login or Register  to view this content.
    But I get an error 1004 "The command cannot be used on multiple selections"

    In the immediate window this results in a valid range with multiple cells:
    Please Login or Register  to view this content.
    So the range is not the issue.
    What am I doing wrong here?

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Copy values of visible cells

    Please Login or Register  to view this content.
    Does this help?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Copy values of visible cells

    Personally I would use something like

    Please Login or Register  to view this content.
    Instead of copy and paste.
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

  4. #4
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Copy values of visible cells

    Thanks for your reply Nathansav,
    It works if I combine it with the solution I got from Hawkeye16 and add instead of .Pastespecial xlValues:
    Please Login or Register  to view this content.
    So my issue is solved now...
    Thanks again.

  5. #5
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Copy values of visible cells

    Thanks for your reply Hawkeye16,

    Your solution did not give always resulted in the right values.
    In a range of A3:A5,A7 the value of A3 was also pasted in A7, but your solution combined with the solution I got from Nathansav it worked fine.
    Thanks again.

  6. #6
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: Copy values of visible cells

    Interesting, wonder why it didn't work. Well, as long as you have a working solution now that is good. Thanks for the feedback!

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy values of visible cells

    Please Login or Register  to view this content.
    Last edited by AB33; 07-16-2014 at 08:59 AM.

  8. #8
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Copy values of visible cells

    I thought I had it solved, but when doing some more testing it appears that non of the 3 solutions seems to be working when I apply a filter on the table.
    So I made a sample file with all of the 3 solutions:

    Sample file copy visible values only.xlsb

    In the example I first add a formula and that paste the values of that formula.
    Can anyone get this working even in a filtered mode ?

    Thanks for helping....

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy values of visible cells

    Your code will not work with tables(If that is what you have).

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy values of visible cells

    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    12-07-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2021
    Posts
    126

    Re: Copy values of visible cells

    I am using tables, so if this does not work I guess I'll have to use a for next loop for every row...

+ 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 Visible cells and paste values only to visible target cells
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2024, 12:01 AM
  2. how to copy from visible cells to visible cells
    By guhaseelan in forum Excel General
    Replies: 2
    Last Post: 04-16-2014, 09:32 AM
  3. [SOLVED] Macro: Copy text values of Visible cells (on a FILTERED data)
    By rampal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 06:12 AM
  4. [SOLVED] Copy/Pasting Values from visible cells (using autofilter) to visible cells
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 07:49 AM
  5. [SOLVED] can only copy/select visible cells w autofilter on &hidden columns, want to copy all cells
    By JTwrk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-25-2012, 02:12 AM

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