+ Reply to Thread
Results 1 to 9 of 9

Based on criteria, loop through sheets copying rows where cell in variable row is blank

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Based on criteria, loop through sheets copying rows where cell in variable row is blank

    Hello. I need some help modifying some code from one report to build a new report.

    I have 29 sheets with a variable list of 400 + rows of data.
    In each Sheet range "O1" hold the due date for that sheet.
    In each sheet Column "B" hold the Part Numbers.
    In each sheet Column "F" holds a completion indicator "X".

    I have the following code that is supposed to go into each sheet and
    If the due date matches the entry in Cell "F1" of my Delta Sheet
    (and ultimately where "B" is not blank & "F" is blank)
    Pull in 7 data points.

    This is my code so far:

    Please Login or Register  to view this content.
    I can't get it to do anything past earlier code that does some formatting & creates the headers.

    Any help is greatly appreciated. Thank you in advance!!
    Last edited by [email protected]; 07-09-2014 at 12:23 PM.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    You need to be specific about the sheet, and the cells in columns B and F:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    Thanks for your help Bernie, I really appreciate it!

    The code runs but does not return any data???

    The headers in the sheet called "Delta Sheet" are in row 4. (I changed "Delta" to "Delta Sheet" in your code)
    This should not be an issue as I tell Excel to "Range("A4").Select" prior to your code.

    For the sheet named 22M.001 alone there should have been 13 rows of data returned.

    Any idea as what we missed?

    There are other "things" going on in this workbook - will that make a difference?
    Should we limit the code to include only sheets 22M.001 through 22M.029 as the sheets to extract data from?

    Thanks again for your help!!

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    Post a small example workbook - a lot of times, it can be the structure of the workbook....

  5. #5
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    Not sure how small this is. I removed most of the data, leaving a lot of the math - so you can see what else is there.

    Thanks!
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    Thanks Bernie. Still won't run though. Even when I run the new code in the sample workbook, it does not return any data.

    Thoughts???

    Thanks for your effort here Bernie. I really appreciate your help!!!

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    I think that when I looked at the date, it converted to a date.

    Try this one:

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 07-09-2014 at 08:33 PM.

  9. #9
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Based on criteria, loop through sheets copying rows where cell in variable row is blan

    Wonderful!! Thanks Bernie it runs great!!

    Thank you so much for all your help!!!
    Last edited by [email protected]; 07-10-2014 at 06:25 PM.

+ 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. Loop Across Columns...If Blank Cell, Loop Down Rows
    By flindy87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2014, 07:05 PM
  2. Loop Across Columns If Blank Cell Loop Down Rows
    By flindy87 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-05-2014, 10:22 AM
  3. Loop through rows and delete based on criteria
    By yolandaro30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-27-2012, 12:23 PM
  4. Copying and pasting rows based on cell criteria
    By techstyle20 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2012, 03:06 AM
  5. Copying variable number of rows to new worksheet based on Findit
    By eonizuka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2010, 03:30 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