+ Reply to Thread
Results 1 to 5 of 5

Copy & Paste val on a filtered list to adjacent column

  1. #1
    Registered User
    Join Date
    06-14-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    10

    Copy & Paste val on a filtered list to adjacent column

    Hi,

    I have a spreadsheet with a helper column. I understand you cant copy and paste correctly from filtered list into adjacent cells. So I'm having to un-filter list then highlight start of orig filtered list cell beginning to end (including blank cells) and then Paste Special skip blanks.

    Is there a solution to this where can leave the filter on and paste into left of the cell from N to M?

    Many Thanks
    Gareth

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,302

    Re: Copy & Paste val on a filtered list to adjacent column

    With a macro - for desktop versions, at least.

    Please Login or Register  to view this content.
    But if you are running the workbook in both versions, you need to follow these instructions:

    PtrSafe keyword
    12/03/2018
    2 minutes to read




    The PtrSafe keyword is used in this context: Declare statement.

    Declare statements with the PtrSafe keyword is the recommended syntax. Declare statements that include PtrSafe work correctly in the VBA7 development environment on both 32-bit and 64-bit platforms only after all data types in the Declare statement (parameters and return values) that need to store 64-bit quantities are updated to use LongLong for 64-bit integrals or LongPtr for pointers and handles.

    To ensure backwards compatibility with VBA version 6 and earlier, use the following construct:

    VB


    Please Login or Register  to view this content.
    When running in 64-bit versions of Office, Declare statements must include the PtrSafe keyword. The PtrSafe keyword asserts that a Declare statement is safe to run in 64-bit development environments.

    Adding the PtrSafe keyword to a Declare statement only signifies that the Declare statement explicitly targets 64-bits. All data types within the statement that need to store 64-bits (including return values and parameters) must still be modified to hold 64-bit quantities by using either LongLong for 64-bit integrals or LongPtr for pointers and handles.
    Last edited by Bernie Deitrick; 06-16-2021 at 10:35 AM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Copy & Paste val on a filtered list to adjacent column

    This code is to copy values from visible cells to visible cells. You can paste to any cell, not just the adjacent cell.
    Run the code > an inputbox will appear > select a range to copy > OK > select only the first cell to paste > OK.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-14-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    10

    Re: Copy & Paste val on a filtered list to adjacent column

    Hi Bernie & Akuini,

    Both work perfectly thank you very much, will be a huge time saver.

    Also thank you for the PtrSafe keyword info

    Many Thanks
    Gareth

  5. #5
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,028

    Re: Copy & Paste val on a filtered list to adjacent column

    You're welcome, glad to help & thanks for the feedback.

+ 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. [SOLVED] Copy and paste in filtered column
    By wongsiuon in forum Excel General
    Replies: 4
    Last Post: 08-27-2019, 10:13 PM
  2. [SOLVED] Copy the filtered dates, do Formatting and paste it back to filtered column
    By Rajkumar_h in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-30-2017, 10:53 AM
  3. how to copy paste in a filtered list
    By zazzz in forum Excel General
    Replies: 15
    Last Post: 11-27-2015, 05:57 PM
  4. Copy from filtered cells and paste to another column
    By floxxie in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-07-2015, 07:19 AM
  5. Replies: 3
    Last Post: 08-28-2012, 10:09 AM
  6. Replies: 4
    Last Post: 08-16-2012, 06:20 PM
  7. Copy & Paste from a filtered list
    By Penelope in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-17-2009, 04:36 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