+ Reply to Thread
Results 1 to 5 of 5

vba help to delete the column till values met desired header

  1. #1
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    vba help to delete the column till values met desired header

    Dear Experts


    I want vba macro to delete the column values till column found exact values
    I have set of mutliple column data in sheet1 i want get result in same sheet with deletion of some existing column heading found in the list of range

    start search the string first COMMITED SERVICE if find the value in first row of any header delete previous columns till ORDER RELEASE DATE
    2nd search string COMMITED SERVICE START if find the value in first row of any header delete previous column till COMMITED SERVICE
    3rd search string COMMITED SERVICE ZONE if find the value in first row of any header delete previous column till COMMITED SERVICE START
    4th search string COMMITED SERVICE RATE if find the value in first row of any header delete previous column till COMMITED SERVICE ZONE
    5th search string COMMITED SERVICE COUNT if find the value in first row of any header delete previous column till COMMITED SERVICE RATE
    last search string COMMITED SERVICE END if if find the value in first row of any header delete previous column till COMMITED SERVICE COUNT

    find the attachment in that sheet1 contains rows header in yellow color

    where finds the values delete left columns till old values met

    in sheet2 is what i expect result by macro
    Attached Files Attached Files

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: vba help to delete the column till values met desired header

    Try this

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.
    Martin

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: vba help to delete the column till values met desired header

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    07-21-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007,2010,2016
    Posts
    695

    Re: vba help to delete the column till values met desired header

    Sir Its works Perfectly !!! I want one modification while run this code i want add this action( replace header value only of B1(order release date) as (commitment release date) in your code rest of all remain same....thanks alot sir

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: vba help to delete the column till values met desired header

    Maybe:

    Please Login or Register  to view this content.

+ 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] Delete Column only after certain Row with Specified Header
    By Pho6 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-16-2013, 02:36 PM
  2. [SOLVED] Delete all cell content in column except for desired string
    By SammieRae in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-23-2013, 06:22 PM
  3. Delete every alternate columns till the last data in the row from column G
    By andywsw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2012, 11:59 PM
  4. Replies: 2
    Last Post: 02-18-2005, 10:06 AM
  5. Replies: 2
    Last Post: 02-18-2005, 10:06 AM

Tags for this Thread

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