+ Reply to Thread
Results 1 to 10 of 10

Macro to extract data that contains certain Text

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

    Macro to extract data that contains certain Text

    I have data on sheet BZTB.



    I have descriptions in Col B on sheet BZTB. Where the descriptions in Col B are like any of the following description ,which will always start with COS , then extract the data that pertains to these in Col A to D and paste these on sheet Tema UV COS in Cols A to D from row 1 onwards


    COS PASS-Used
    COS COMM-Used
    COS W/S PASSENGER-Used
    COS W/S PASSENGER-Used
    COS W/S COMMERCIAL-Used
    COS W/S GROUP-Used

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro to extract data that contains certain Text

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  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 that contains certain Text

    Thanks for the amended Code Sintek

    The Criteria in Col B on sheet BZTB should contain the following uing a wildcard

    COS Pass Used
    COS Pass *** Used
    COS Pass Used
    COS Pass depr Used
    COS Comm Used
    COS Comm *** Used
    COS Comm Used
    COS Comm depr Used
    COS W/S Passenger Used
    COS W/S Commercial Used
    COS W/S Commercial Used
    COS W/S Used


    I have manually extracted the data -see sheet Manual Extraction so you can see what I am trying to achieve

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro to extract data that contains certain Text

    Yet you said...
    which will always start with COS
    So is it only the 3...
    COS Pass*
    COS Comm*
    COS W/S*
    Last edited by sintek; 04-28-2023 at 10:07 AM.

  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 that contains certain Text

    That is correct. It must include Used

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro to extract data that contains certain Text

    Please Login or Register  to view this content.

  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 that contains certain Text

    Many thanks Sintek

    The text containing these items are not being Extracted

    Please Login or Register  to view this content.

    I have attached the workbook, showing you what data was pasted running your code

    Kindly amend code

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro to extract data that contains certain Text

    That is because your sheet still has filters in place...remove them and then run the code...Same output

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

    Re: Macro to extract data that contains certain Text

    Thanks for pointing this out. Code works 100%

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro to extract data that contains certain Text

    Happy to help Howard...Tx for rep...Happy Coding...

+ 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] extract text form text string( extract 5 charactors in front of all left parenthese)
    By happyexcel2021 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-30-2021, 06:05 PM
  2. VBA Macro to extract multiple bit of data from long text string in single cell in Excel
    By RickyGerbilFace in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-06-2020, 07:54 PM
  3. [SOLVED] Extract alt text from a website with macro
    By Alexander12345 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2016, 10:13 AM
  4. [SOLVED] Extract text from a given point in a text string, when data points do not share the given
    By reedersketer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2014, 03:57 PM
  5. Macro to loop through data validation saving extract results as text files
    By Jugo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2013, 10:53 PM
  6. [SOLVED] Convert text file to CSV and extract data loop macro help
    By Savan87 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-23-2012, 04:42 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