+ Reply to Thread
Results 1 to 2 of 2

VBA: Extract variable number of rows per variable number of phone numbers

  1. #1
    Registered User
    Join Date
    03-07-2017
    Location
    california
    MS-Off Ver
    2010
    Posts
    1

    VBA: Extract variable number of rows per variable number of phone numbers

    VBA: Extract variable number of rows per variable number of phone numbers

    We are looking to automate this process using Excel VBA/macros because we process two to ten spreadsheets a week. We want to extract a certain number of rows per a variable set of phone numbers. For example: a spreadsheet with 200,000 rows has 20,000 rows assigned to ten phone numbers. We want to extract the first ten rows per phone number. Our resulting file will have 100 rows ordered by phone number.


    Notes: We need to extract a variable number of records per phone number.
    The number of columns can vary. The number of rows can vary.
    We need the entire row of data.
    The phone number column may be in a different place in each spreadsheet.
    The number of phone numbers may vary.

    Here's a code that works on one file, but cannot be duplicated to another worksheet because the "field", "criteria" and "rows" change per worksheet.

    We thought Index/Match might work, but it only returns one item, rather than duplicates.

    We don't have a VBA solution, so we do this manually.

    Posts were added to mrexcel.com and stackoverflow.com

    stackoverflow excel-vba-extract-variable-number-of-rows-per-variable-number-of-phone-numbers
    mrexcel vba-extract-variable-number-rows-per-variable-number-phone-numbers

    Any help would be appreciated!

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by redstone2830; 10-18-2018 at 12:12 PM. Reason: adding corrections per jindon

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

    Re: VBA: Extract variable number of rows per variable number of phone numbers

    1)
    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    2)
    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

+ 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] Phone number format - reference post (Formatting Textbox to type phone numbers only)
    By eddyrcabrera79 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2015, 05:35 PM
  2. Macro to cut and paste a variable number of rows to a variable location?
    By TheClaw2323 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2015, 07:57 AM
  3. Macro to insert a variable number of rows into a variable location
    By TheClaw2323 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-08-2015, 05:31 AM
  4. Replies: 3
    Last Post: 02-17-2015, 11:53 PM
  5. [SOLVED] Calculate average of variable number of cells variable number of times
    By WeirnetherlandsBart in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2014, 10:11 AM
  6. Extract fixed number from variable text strings
    By IM22 in forum Excel General
    Replies: 27
    Last Post: 05-14-2012, 08:19 PM
  7. Replies: 6
    Last Post: 04-14-2012, 04:07 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