+ Reply to Thread
Results 1 to 4 of 4

conditional row delete and autofilter

  1. #1
    Registered User
    Join Date
    08-27-2007
    Location
    San Antonio Texas
    Posts
    41

    conditional row delete and autofilter

    Help! I've been struggling with this for the past few weeks, and I'm hoping one of y'all can help me get past this.

    What the macro is supposed to do is to load the file (customer.xls), delete columns and rows of data that aren't needed, and then delete additional rows of data that can be excluded based on conditional criteria.

    If I run the macro as a whole, it deletes all rows save for the header row and leaves the auto filter set to 'on'. This despite turning the autofilter off at the conclusion of each of the subs. If I comment out the portion at the top which calls the subs and run the subs individually, it works, but with each sub i have to go back to the spreadsheet and manually turn the autofilter off.

    The command to turn the autofilter off is included in each of the subs, but for some reason it isn't doing it. I have included a sample of the data that I'm working with, and the macro I'm using. Thanks in advance.

    Marcus

    HTML Code: 
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Marcus

    I put a copy of your file on my PC, then put your code into a blank workbook. Changed the path and then ran your main code.

    Seemed to work OK. Still had data at the end, and the autofilter was not active.

    One thing - is your file really stored as a spreadsheet, not just have a .xls suffix? When I tried to save it, the file went to a default text mode...


    rylo

  3. #3
    Registered User
    Join Date
    08-27-2007
    Location
    San Antonio Texas
    Posts
    41

    could it be a configuration problem?

    hey rylo - interesting. on my home computer, my laptop and the office computer i get the exact same results. the macro never turns the autofilter off. i can do it manually, but when run either as one macro or several small one's it always leaves the autofilter on. i'm wondering if this could be a configuration problem? i'm running excel 2003 if that's of any help.

    yes, when quickbooks exports the file it does so as a text file which i apply the xls extension to. it won't affect the reports that the macro will generate at the end of the routine so i haven't bothered trying to do anything with it.

    thanks for your help - marcus

  4. #4
    Registered User
    Join Date
    08-27-2007
    Location
    San Antonio Texas
    Posts
    41

    a possible problem of macro placement

    Greetings - I've been working on this macro most of the day and evening (again), looking at other threads with similar issues, and though I don't yet know how to resolve the autofilter switch and delete issues, I believe it may have something to do with where the macro is relative to where it loads the customer data.

    When I initially bring up excel I Alt-F11 and I see a tree structure that consists of the following:

    VBAProject (Book1)
    Microsoft Excel Objects
    Sheet1
    Sheet2
    Sheet3
    ThisWorkbook
    VBA Personal Project (Personal.xls)
    Microsoft Excel Objects
    Sheet1
    ThisWorkbook

    Do I need to somehow get rid of the Personal Project, or is there some particular place I should be putting the macro? Hopefully this is the missing piece of information. Thanks in advance

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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