+ Reply to Thread
Results 1 to 4 of 4

Duplicate and serialize rows

  1. #1
    Registered User
    Join Date
    02-13-2019
    Location
    Slovenia
    MS-Off Ver
    Professional 2016
    Posts
    12

    Smile Duplicate and serialize rows

    Dear hive mind,

    I work in library-digitization, am no stranger to renaming software, xml, Excel and macros, but I'm not an expert, I usually adjust the code, unfortunately am not on able to code from scratch.

    I am humbly asking for help with my task.

    I have spreadsheet with two columns, one contains the first page of a book with old wrong file name, next one with correct name. I already have a way to rename actual files based on spreadsheet.

    The challenge is that I only have the file names of first page of the book in Excel rows, but I have to rename all the scans from the book, and it can have random number of pages ranging from 1 to 100.

    I'm looking for a formula or macro that does the following:
    - It copies every row 100 times (both columns)
    - It serializes the all 100 duplicate rows - changes last 3 digits in the name (both columns)
    Example:

    Before:
    id-AAAAA_scn-001.jp2 id-WWWWW_scn-001.jp2 First book, first page

    id-BBBBB_scn-001.jp2 id-XXXXXX_scn-001.jp2 Second book, first page

    After:
    id-AAAAA_scn-001.jp2 id-WWWWW_scn-001.jp2
    id-AAAAA_scn-002.jp2 id-WWWWW_scn-002.jp2
    ...
    id-AAAAA_scn-100.jp2 id-WWWWW_scn-100.jp2

    id-BBBBB_scn-001.jp2 id-XXXXXX_scn-001.jp2
    id-BBBBB_scn-002.jp2 id-XXXXXX_scn-002.jp2
    ...
    id-BBBBB_scn-100.jp2 id-XXXXXX_scn-100.jp2

    If the .jp2 represents a hurdle I can remove it and add it back, I'm just hoping someone can help with duplicating and serializing the spreadsheet.

    Once I have a list I can rename files that exist and skip ones that don't exist, so it's no problem if a book has 4 or 100 pages and I've checked and most pages is 80.

    Hope someone more skilled can help and likes the challenge. Hopefully I've attached a sample spreadsheet.

    Thank you in advance I'll would be very grateful for any help since this is only one part of a bigger puzzle I'm trying to solve. Best regards
    Attached Files Attached Files
    Last edited by Slovenian; 11-30-2022 at 08:37 AM.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Duplicate and serialize rows

    vba
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-13-2019
    Location
    Slovenia
    MS-Off Ver
    Professional 2016
    Posts
    12

    Re: Duplicate and serialize rows

    Jindon thank you so much for your help! Your code works even better than I dared to hope.

    If there is any way I can show my gratitude other than adding reputation let me know. Have a great day, you sure made mine better.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Duplicate and serialize rows

    You are welcome and thanks for the rep.

    Thanks for the kind offer, but "Thank you" is the mightly word to make us happy and good enough...

+ 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] Removing duplicate rows based on single column duplicate values
    By Miasav90 in forum Excel General
    Replies: 7
    Last Post: 09-23-2021, 08:40 AM
  2. Print # command to print copies & serialize
    By Dean Zuki in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-01-2016, 12:26 AM
  3. [SOLVED] Delete rows based on duplicate cell, but leaving first and last duplicate.
    By LadyNicole in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2013, 05:07 AM
  4. VBA helps needed to Sum duplicate values and delete duplicate rows
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2013, 11:40 PM
  5. How to serialize a variable without knowing how many instances are required?
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-29-2009, 11:19 AM
  6. How To Serialize Each Copy Of Workbook
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2009, 04:59 AM
  7. Replies: 0
    Last Post: 05-23-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