Results 1 to 7 of 7

Macro for combining columns and duplicating rows based on data

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-09-2008
    Location
    Washington State
    MS-Off Ver
    2007
    Posts
    164

    Macro for combining columns and duplicating rows based on data

    I am attaching a sample spreadsheet which should provide a better idea of what I hope to do.

    In rows 1-10 I have a sample of the data I wish to massage, and is defined as:
    A: an image
    B: an alternate name for the image
    C: a geographic location for where the image is located, defined as Township/Range
    1. The first two-digit number is a 'Township' Number. This number will always be two digits.
    2. A space
    3. A one or two digit number followed by a W for west or an E for east.

    Update:
    **Please note that this number may be provided as a single digit (ie. 4 which would result in 04) or a double digit (ie. 12 which would result in 12)** The spreadsheet has also been updated with an example of a double-digit Range.**

    D: more geographic location information regarding the location of the image regarding Section.
    1. The section will always be two-digits, hence 02 for section 2. This column also includes some letters (P and S) which have no meaning and will need to be deleted during the massage.
    E: comments regarding the image.
    Please note that the images are not included in this sample, just their names.

    Rows 15-33 are what I hope to have as a result.
    A: is the image name repeated from above
    B: the alternate name for the image repeated from above
    C: is a combination of columns C and D (rows 1-10) from above. The Township number is repeated with a 'N/' added to it. The Range number is combined with a '/' added to it. and only one of the Section numbers (two digits) is added to it. The row is then duplicated with another (different) of the section numbers. The row is duplicated as many time as there are different (two-digit) numbers in the original 'D' column (rows 1-10). (ie. Row 1 is duplicated four times and becomes rows 15-18.

    I hope to have the results displayed on Sheet 2 so that the original data can be preserved for other uses.

    I hope to use a Macro as this is just a sample which will be used on data which exceeds 100,000 total rows, but no more than 1,000 rows at a time.

    Any help provided is appreciated.
    Attached Files Attached Files
    Last edited by rylo; 03-27-2011 at 05:36 PM. Reason: additional criteria

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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