+ Reply to Thread
Results 1 to 8 of 8

A macro that only runs on a group of concurrent(?) rows with specific data in one column.

  1. #1
    Registered User
    Join Date
    01-31-2016
    Location
    N Dakota
    MS-Off Ver
    07
    Posts
    16

    A macro that only runs on a group of concurrent(?) rows with specific data in one column.

    First, the devs on this site are incredible. We tell everyone about this site, head and shoulders above other similar sites! Thank you!


    Ok, I've been trying to figure this out for a long time! It's really past my level.

    This is part of a fairly complex Excel Macro, that I plan to Call near the end. I can post the whole Macro if needed.

    Simply put, we need an Macro that looks for TX in column F, and the good news is that those rows are always concurrent(?), say all rows 35 through 48 or 41 through 62. As you can see, which rows in any given file are variable; my personal dilemma.

    All entries are in a single worksheet, sorted via State in column F, with data in columns A through P, and tab delimited.

    So the action to apply on all rows with 'TX' in column F, is a custom (expanded) sort via Column C, the phone number.

    That's it. If the rows were always the same numbers, no problem, but it's variable; my nemesis.

    Thank you for any help you can provide!

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: A macro that only runs on a group of concurrent(?) rows with specific data in one colu

    Try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    01-31-2016
    Location
    N Dakota
    MS-Off Ver
    07
    Posts
    16

    Re: A macro that only runs on a group of concurrent(?) rows with specific data in one colu

    Thanks Mumps! I think it's real close.

    It breaks on line 8
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear

    run-time error '9':
    Subscript out of range


    Not that I thought it was related, I did try replacing "Sheet1" with "CurrentLeadFileUsing.txt" since I know the file name at this point in the script.

    Here's an example of a generic file just in case. http://onlineautomation.com/download...adFileUsing.7z

    Thanks again!
    Mark

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: A macro that only runs on a group of concurrent(?) rows with specific data in one colu

    The file that you posted has an unusual extension and I couldn't open it. Can you post a file in Excel format?

  5. #5
    Registered User
    Join Date
    01-31-2016
    Location
    N Dakota
    MS-Off Ver
    07
    Posts
    16

    Re: A macro that only runs on a group of concurrent(?) rows with specific data in one colu

    Sorry about that. It's just compression. Here's the more standard zip file.

    http://onlineautomation.com/download...dFileUsing.zip

    It is a tab delimited text file of course, one of the std files for Excel.

    Thanks again!
    Mark

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: A macro that only runs on a group of concurrent(?) rows with specific data in one colu

    The sheet name in your file did not match the standard sheet name I used in the macro. Try the following:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-31-2016
    Location
    N Dakota
    MS-Off Ver
    07
    Posts
    16

    Re: A macro that only runs on a group of concurrent(?) rows with specific data in one colu

    Spot on Mumps!

    Oh I was SO close with that last one! lol

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: A macro that only runs on a group of concurrent(?) rows with specific data in one colu

    Glad it worked out.

+ 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] Data Parsing - Segregating rows data under specific column headers - Macro creation
    By harman83 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2016, 04:55 PM
  2. Group together rows using specific data from 2 different columns
    By DSET13 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-28-2015, 06:51 PM
  3. [SOLVED] group Rows based on a specific value in column
    By Lisa4legin in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-14-2014, 07:21 PM
  4. Need macro that will group rows with duplicate data in a particular column together
    By MineThatBird in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-08-2013, 07:32 PM
  5. Replies: 12
    Last Post: 02-21-2013, 12:55 PM
  6. [SOLVED] Macro for inserting specific rows with data when there is a change in the column
    By KILOJulz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2013, 04:19 AM
  7. [SOLVED] Group & sort rows that have a specific value in column C
    By Lex in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2006, 07:50 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