+ Reply to Thread
Results 1 to 7 of 7

Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,725

    Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

    I have Data on sheet1


    I need to extract the data on Sheet1 in Cols A:D and paste in Sheet sales where the following text appears in Col B on sheet1 in any combination as long as it contains this text



    1) Sale Omno
    2) Sale Used

    I have highlighted the items on sheet1 that is based on the above criteria which needs to be copied to sheet sale

    I have tried to write code to do this, but no data is being copied

    It would be appreciated if someone could kindly assist me

    Please Login or Register  to view this content.
    Last edited by Howardc1001; 03-31-2023 at 10:46 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

    Please Login or Register  to view this content.


    You have several like:
    Please Login or Register  to view this content.
    but you only want the yellow record copied, so your test criteria aren't going to work.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,725

    Re: Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

    Thanks Ben

    The criteria must include

    1) Sale Omno
    2) Sale Pass or Passenger Used
    3) Sale Comm or Commercial Used


    Kindly amend code

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

    Quote Originally Posted by Howardc1001 View Post
    1) Sale Omno
    2) Sale Pass or Passenger Used
    3) Sale Comm or Commercial Used
    Use of AdvancedFilter
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,725

    Re: Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

    Thanks Jindon. It works 100%

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

    Just for the heck of it, using "Instr" what you have in your code.
    It loops so it will be slower on larger data ranges.
    I assume that the B8 Row ("Sale Retail Demo New") was accidently coloured yellow and should not be copied to other sheet.
    Please Login or Register  to view this content.
    Experience trumps academics every day of the week and twice on Sunday.

  7. #7
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,725

    Re: Macro to Extract data from Sheet1 to sheet Sales Based on specific Criteria

    Thanks for your code Jolivanes

    Sale Retail Demo New" was accidently coloured yellow and should not be copied to other sheet

+ 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] Macro to Hide Columns in All Sheets based on criteria in Sheet1
    By toci in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 03-30-2016, 08:38 PM
  2. Replies: 7
    Last Post: 09-30-2014, 01:44 PM
  3. Replacing sheet1 data with sheet 2 data for specific columns using macro
    By aniletc37 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2014, 02:19 PM
  4. extrac data from different sheets by sheet name and copy the workbook names
    By ripple in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2013, 11:26 AM
  5. Copy certain data from Sheet1 to Sheet 2 based on values in a column on Sheet1
    By theglitch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2013, 01:28 PM
  6. HELP! Macro to Copy specific cells from one sheet to another based on specific criteria
    By atriscritti in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2012, 11:05 AM
  7. [SOLVED] Copy and paste data from sheet 2 to sheet 1 based on specific criteria on sheet 1
    By VBADUD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-05-2012, 04:18 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