+ Reply to Thread
Results 1 to 5 of 5

VBA to copy & paste VALUES based on criteria

  1. #1
    Registered User
    Join Date
    08-02-2017
    Location
    ny
    MS-Off Ver
    2013
    Posts
    20

    VBA to copy & paste VALUES based on criteria

    Hello,

    I need a macro that will paste cell values from one sheet to another.

    On sheet named "filtered"

    Column A = Account
    Column B = "no" or "upload"

    Columns A and B are both formula driven.

    If the formula returns "upload" in Col B, I would like the VALUE of cell A to paste over into the sheet named "upload". If the formula returns "no", I would like to skip that row and move to the next.

    Any help is greatly appreciated!

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

    Re: VBA to copy & paste VALUES based on criteria

    Hello Stacymyers11,

    Try the following code placed in a standard module and assigned to a button:-

    Please Login or Register  to view this content.
    The code filters Column B for the criteria "Upload" in the "Filtered" sheet then copies/pastes the adjacent value from Column A into Column A of the "Upload" sheet.

    Check the spelling of the sheet names. Make sure that the sheet names on the tabs and in the code match exactly.

    Test the code in a copy of your workbook first.

    I hope that this helps.

    Cheerio,
    vcoolio.

  3. #3
    Registered User
    Join Date
    08-02-2017
    Location
    ny
    MS-Off Ver
    2013
    Posts
    20

    Re: VBA to copy & paste VALUES based on criteria

    This works great, thank you!!

  4. #4
    Registered User
    Join Date
    08-02-2017
    Location
    ny
    MS-Off Ver
    2013
    Posts
    20

    Re: VBA to copy & paste VALUES based on criteria

    Hi again,

    the code was working, I exited the workbook and now I am getting an error:

    Capture.PNG

    This is the line giving the error:

    With ws.Range("B2", Range("B" & Rows.Count).End(xlUp))

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

    Re: VBA to copy & paste VALUES based on criteria

    Hi StacyMyers,

    The PNG doesn't work so I can't see the error. Could you tell me what the error says please.

    In the meantime, try changing this line:-

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    Let me know how it works out.

    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. Help with VBA/Macro to copy and paste values based on criteria
    By Bhaz in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-04-2018, 10:43 AM
  2. Copy paste Values based on criteria
    By toci in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 04-15-2016, 08:29 AM
  3. Alternative to copy and paste values based on criteria
    By krishns in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-10-2015, 12:07 PM
  4. Replies: 1
    Last Post: 10-05-2014, 12:28 PM
  5. [SOLVED] copy Tabs, based on two criteria in column J and paste values
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-13-2013, 03:46 PM
  6. [SOLVED] Macro to Copy Data and Paste Values Based on cell criteria
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 06:51 PM
  7. copy and paste values based on a criteria
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 11-15-2008, 11:35 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