+ Reply to Thread
Results 1 to 4 of 4

Need macro to copy and paste formats and values but exclude null values

  1. #1
    Forum Contributor
    Join Date
    05-30-2021
    Location
    Colorado Springs
    MS-Off Ver
    Microsoft 365
    Posts
    173

    Need macro to copy and paste formats and values but exclude null values

    The macro below copies data from one sheet ("Import template") to another ("Import_Ctrl+t"), but I need the code modified so that it pastes formats AND values, and also do not copy or paste a row if the cell in Column D in "Import template" is null.

    Please Login or Register  to view this content.
    Last edited by kyle4570; 06-18-2021 at 01:54 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,033

    Re: Need macro to copy and paste formats and values but exclude null values

    Hello Kyle,

    An easy way to do so is to use the AutoFilter:-

    Please Login or Register  to view this content.
    I've used sheet codes instead of sheet names in the sub-routine.
    I've assumed that your data starts in row2 with headings in row1 of the "Import Template" sheet.

    I hope that this helps.

    Cheerio,
    vcoolio.

  3. #3
    Forum Contributor
    Join Date
    05-30-2021
    Location
    Colorado Springs
    MS-Off Ver
    Microsoft 365
    Posts
    173

    Re: Need macro to copy and paste formats and values but exclude null values

    Perfect, thanks!
    Last edited by kyle4570; 06-20-2021 at 03:44 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,033

    Re: Need macro to copy and paste formats and values but exclude null values

    You're welcome Kyle. Glad to have been able to assist.

    Cheerio,
    vcoolio.

+ 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. How do I calculate an average and exclude the null values?
    By Kalkul8 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2020, 02:51 AM
  2. [SOLVED] Copy paste values and formats
    By eazy899 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-11-2018, 01:45 AM
  3. Export sheets copy/paste Values And Formats with merge cells
    By creusemeninge in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 09:55 AM
  4. [SOLVED] Copy and paste values and number formats pastes formatting
    By Canthandlemyhandle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-27-2012, 06:21 PM
  5. Hide/Exclude Null Values in Pivot table
    By halefamily104 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-11-2012, 12:54 PM
  6. [SOLVED] Copy and paste special values and formats
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2012, 07:14 AM
  7. Copy and paste to retain formats and values not quite working as a one liner
    By johnbirt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2012, 12:11 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