+ Reply to Thread
Results 1 to 8 of 8

macro to retain Certain Data

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

    macro to retain Certain Data

    I have a list of suppliers in Col B


    I need a macro to retain only those that contain the items below and to delete the balance from row 2 onwards

    1) ETE
    2) Auto
    3) BRM Investments


    Your assistance in this regard is most appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: macro to retain Certain Data

    1 Everything with the prefix 'ETE'
    2 Does Auto include Auto works
    3 Are texts prefixed BR BRM Investments
    4. Are the balances of all of the others to be removed or the whole line, you know what you want to do, hard to guess from here

    just these few pointers would help a lot

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

    Re: macro to retain Certain Data

    Thanks for the reply

    1) Everything with the prefix 'ETE' to be included
    2) Auto include Auto works
    3) texts are not prefixed BR BRM Investments-Only include BRM Investments

    4) All items items are to be deleted from row 2 onwards


    Sorry for not being clearer in Post #1

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

    Re: macro to retain Certain Data

    4) All items items are to be deleted from row 2 onwards
    The above Makes no sense...If you want to delete all items from row 2 onwards then why need to check to retain data?

    First was...
    delete the balance from row 2 onwards
    so which is it?

    Do you want Balance column cleared?
    Last edited by sintek; 11-26-2021 at 12:42 PM.
    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!!!

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

    Re: macro to retain Certain Data

    Hi Sinek

    I want to retain the following items in Col B

    1) Those that are prefixed with ETE
    2) Those that are prefixed with Auto
    3) Those that contain BRM Investments (not in sample data)

    All the the rows from 2 to be deleted , except the items mentioned above

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

    Re: macro to retain Certain Data

    Please Login or Register  to view this content.

  7. #7
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: macro to retain Certain Data

    try on a copy of data
    Please Login or Register  to view this content.

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

    Re: macro to retain Certain Data

    Hi Guys

    Many thanks for the help. Have tested your code and they both work perfectly

+ 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 retain cerain Data in Col A
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2021, 12:19 AM
  2. [SOLVED] Macro to retain data in Col E
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2021, 01:08 PM
  3. [SOLVED] MACRO to retain format when expoting as a CSV
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-18-2019, 02:14 PM
  4. [SOLVED] macro to retain certain Data
    By flupsie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2018, 03:49 AM
  5. [SOLVED] Macro to retain only certain items
    By flupsie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2017, 07:00 AM
  6. Need macro to retain the entire row data between two headers in a particular column
    By Nikkishr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2012, 06:41 PM
  7. Retain the Value of a Variable in Macro
    By blueperfume300 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2007, 04:19 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