+ Reply to Thread
Results 1 to 8 of 8

Identify data ranges and remove any superfluous ranges

  1. #1
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Identify data ranges and remove any superfluous ranges

    I have a spreadsheet populated from a database, the output format of which I cannot alter, as shown attached.

    I need to identify ranges, based on a name for example, and get rid of everything else.

    In the attached example it can be seen that i have ranges based on colour names, blue, red, pink, etc. Each of these ranges contain columns containing data, labelled 1, 2, 3, etc. (i.e. Row 2 contains headings)

    In this example I wish to select the ranges relating to black, i.e. black 1, 2 & 3 and remove all other columns.

    Could anyone please assist.

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,701

    Re: Identify data ranges and remove any superfluous ranges

    Show the expected output too for better understanding


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Identify data ranges and remove any superfluous ranges

    Ok, workbook attached with inital data (sheet1) and desired result (sheet2).

    The required ranges may not be the same each time the report is run, i.e. there may be black1 through to 5 and they could be dispersed within the sheet in the way that yellow is shown between black2 and black3.

    Thanks,
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-13-2010
    Location
    England
    MS-Off Ver
    Office 2016 365
    Posts
    211

    Re: Identify data ranges and remove any superfluous ranges

    Arghghghhgh Merged Cells!

  5. #5
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Identify data ranges and remove any superfluous ranges

    Oh I know...it was much worse than that! I've had to leave the headers in Row1 merged otherwise it becomes impossible to see which headings in Row2 refer to those in Row1.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,701

    Re: Identify data ranges and remove any superfluous ranges

    Try this code...

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Identify data ranges and remove any superfluous ranges

    That's brilliant, thank you.

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,701

    Re: Identify data ranges and remove any superfluous ranges

    Glad it helps you and thanks for the feedback

+ 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. Replies: 6
    Last Post: 07-29-2013, 02:11 AM
  2. Need VBA_VBasic help to Identify values among ranges
    By pachuken2012 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2012, 10:23 AM
  3. [SOLVED] Extracting Data From Charts Using Ranges (V-Lookup W/ Ranges?)
    By Kolin in forum Excel General
    Replies: 9
    Last Post: 04-14-2012, 05:39 PM
  4. Copy data in named ranges to a newer version of the same template to identical ranges
    By handstand in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2006, 10:51 AM
  5. VBA - Identify Begin/End of Cell Ranges
    By ajocius in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-26-2005, 11:05 PM

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