+ Reply to Thread
Results 1 to 12 of 12

VBA autofilter on computed table column does not work?

  1. #1
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    VBA autofilter on computed table column does not work?

    I find that if I use VBA to run an autofilter on a table column of values it works fine, but if I use the same VBA to run an autofilter on the column adjacent to it that has computed values (a formula, no matter how simple, instead of a value, even though the formula displays a numeric value) the filter collapses every single record (row). If I engage the autofilter manually from the spreadsheet on the computed column it works fine - only bad when I run it from VBA.

    I am about to put a band-aid on it by running a copy - pastespecial - values on that table's column and running the autofilter on that column, but I think there must be a better way!

    Thoughts?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: VBA autofilter on computed table column does not work?

    My VBA skills are weak at best, but...
    if it works on values
    if it works manually on formulas
    if it does not work with code...

    Then maybe your code is at fault?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: VBA autofilter on computed table column does not work?

    I just created a 2=column range, 1 column values, the other a formula. I then recorded a macro to sort on the values columns - then chaged the macro range to sort based on the formula column. Both sothed without a problem....
    Please Login or Register  to view this content.

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: VBA autofilter on computed table column does not work?

    Post your workbook.

    ViewPic
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  5. #5
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: VBA autofilter on computed table column does not work?

    You tell me, here's what I got - olow0s8 is the name of the table.





    Please Login or Register  to view this content.
    The line that is not working is

    Please Login or Register  to view this content.
    If i change the field to 10, obviously immediately adjacent and prior to the errant run column, it filters it perfect.

    The only difference between the two is that column 10 has values and column 11 is a SUM of three values.

    Just saw your new post come in, about to read-


    @skywriter - Will try, need to redact the info...

  6. #6
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: VBA autofilter on computed table column does not work?

    If I told you I had a tooth pulled yesterday that took an hour and a half to rip out and should stay away from my computer when on meds, will you cut me a little slack?

    I am going to shut up now and not post for a couple of days. I found the error. Please pardon me and any trouble I caused...

    @FDibbins: In addition to the other one from today, would you be so kind as to make this one disappear?

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: VBA autofilter on computed table column does not work?

    You are not causing any trouble or problems at all, so please dont feel you are

    I know all about having problems pulling teeth, I hope you feel better soon. 1 of the biggest problems with written comms like this, is that it can be hard to tell the "mood" of what is said, just be reading what was said. I doubt anyone was busting on you (I know I wasnt)

    Often what is glaringly obvious to you, we cannot see at all - and vise versa. Get some rest and get back to us when you can. If you need to get back to this thread in a day or so, "subscribe" to it (unless you already have?), so you can find it easier

  8. #8
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: VBA autofilter on computed table column does not work?

    will you cut me a little slack?
    No way, let the tightening begin!!!

    Been there done that. I had two impacted wisdom molars pulled back in the early 80's. While I was waiting for the drugs to kick in I heard the girl in the next room crying hysterically while the oral surgeon pulled her teeth. When he came back in to check on me he saw the look on my face and said, "relax she didn't feel a thing she's just being hysterical." My response was, "I only care whether I'll feel it or not, if I don't feel it I don't care." I didn't feel a thing and the after drugs were pretty good too.

    Speedy recovery,
    Bruce(skywriter)
    Last edited by skywriter; 01-08-2016 at 09:45 PM.

  9. #9
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: VBA autofilter on computed table column does not work?

    Thanks Gentlemen-

    Dang. I just violated my "not post for a couple days" promise...

  10. #10
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: VBA autofilter on computed table column does not work?

    Quote Originally Posted by brucemc777 View Post
    Thanks Gentlemen-

    Dang. I just violated my "not post for a couple days" promise...
    Must be the meds.

  11. #11
    Forum Contributor
    Join Date
    01-08-2016
    Location
    Cagayan De Oro City, Philippines
    MS-Off Ver
    2013
    Posts
    152

    Re: VBA autofilter on computed table column does not work?

    Hi, not sure if you managed to get this problem solved, i didnt really plan on looking through all the arguing going on but, there are certain datatypes require you use xlbetween and use < and > together to single out a value and not xlEquals, its something i came across a while back and at the time seemed strange.... but then again most errors seem strange in VBA.......give it a try and let me know.

    Thanks
    Paul S.

  12. #12
    Forum Contributor
    Join Date
    03-05-2007
    Location
    Falmouth, VA now, Palm Bay, FL for 2 yrs, was Colorado Springs, CO for ten years; Cedark Park, TX; Zeeland, MI; Wilmette, IL; Princeton Junction, NJ; NY, NY
    MS-Off Ver
    365
    Posts
    583

    Re: VBA autofilter on computed table column does not work?

    It was a very dumb (hopefully I can write it off to "med influenced") mistake, the second that I made and posted over today, but Thank-you nonetheless!

+ 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. AutoFilter on Protected Table Does Not Work with VBA
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-29-2013, 01:43 AM
  2. [SOLVED] How to present a computed column in a pivot chart?
    By GIS2013 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-18-2013, 02:16 AM
  3. Replies: 10
    Last Post: 08-12-2010, 08:01 AM
  4. Adding a Computed column at end for a growing list using Fn-No macros
    By roshankp in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2010, 05:58 AM
  5. [SOLVED] how do i get my data table column inputs to work?
    By wms in forum Excel General
    Replies: 0
    Last Post: 02-14-2006, 04:30 PM
  6. How do I sort a column of computed variables in EXCEL?
    By Sylgeox in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2005, 08:05 PM

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