+ Reply to Thread
Results 1 to 3 of 3

Loop thru folder of files, delete rows with with 1 in column F; still some rows left

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Bangor, Maine
    MS-Off Ver
    Excel 2007
    Posts
    28

    Loop thru folder of files, delete rows with with 1 in column F; still some rows left

    The loop VBA code is below that I am using. I have xlsx files with hundreds of rows. Column F is Boolean with 1 or 0. I need to delete all rows where there is a 1. The code runs great but at the end, each file still has some rows at the end that still have a 1. I've been reading about how you have to start at the bottom and delete up. Is this my problem. A push in the right direction would be great. I don't quite understand how to do this backwards. Much thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Loop thru folder of files, delete rows with with 1 in column F; still some rows left

    Please Login or Register  to view this content.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    02-05-2013
    Location
    Bangor, Maine
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Loop thru folder of files, delete rows with with 1 in column F; still some rows left

    walruseggman, Thanks for the prompt reply.

    The code is hanging on your first line (rng...). Run-time error '91'. Object variable or With block variable not set. Can you elaborate on this error? Thanks.
    Please Login or Register  to view this content.

+ 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 Through All Files In Folder And Delete As Per Condition
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2015, 05:05 PM
  2. Replies: 3
    Last Post: 01-05-2014, 05:50 AM
  3. Loop to search specific names in column and delete other rows
    By EJ_2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2013, 01:28 PM
  4. Loop through a folder and paste rows from a master workbook
    By amandae27 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-09-2013, 11:27 AM
  5. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  6. [SOLVED] Loop through folder of workbooks and add rows
    By FIRSTROUNDKO via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-10-2006, 02:55 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