+ Reply to Thread
Results 1 to 6 of 6

Userform with listboxes for autofilter causing Error 1004

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Poland
    MS-Off Ver
    Excel 365 64bits
    Posts
    46

    Userform with listboxes for autofilter causing Error 1004

    Dear All,

    i tried to find such issue.

    there is a simply userform with two listboxes for selection data.
    Data are being filtered based on criteria (listbox). see attached file.
    Listbox2 - Region selection works fine and autofilter select the values well.
    Listbox3 - Representation selection fails causing Error 1004.

    to be fair i dont understand why (or what i do wrong).

    can you please help me here?

    attached, please find the file.

    thanks in advance for any comment.
    Attached Files Attached Files
    Last edited by sknalodz; 05-19-2020 at 07:42 AM.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Userform with listboxes for autofilter causing Error 1004

    Please Login or Register  to view this content.
    You are referencing 2nd column but range is only A
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    Poland
    MS-Off Ver
    Excel 365 64bits
    Posts
    46

    Re: Userform with listboxes for autofilter causing Error 1004

    so easy... thank you for your help.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Userform with listboxes for autofilter causing Error 1004

    anytime...tx for rep +

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Userform with listboxes for autofilter causing Error 1004

    Maybe some usefull modifications.
    Attached Files Attached Files
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  6. #6
    Registered User
    Join Date
    01-22-2013
    Location
    Poland
    MS-Off Ver
    Excel 365 64bits
    Posts
    46

    Re: Userform with listboxes for autofilter causing Error 1004

    more than useful, looking for such answer i know i dont know vba at all... even creating apps for last years...

+ 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. Range formula is causing me error 1004.
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-21-2016, 01:12 PM
  2. PasteSpecial causing RunTime error 1004 & autofill doesn't stop at last line
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-24-2014, 09:18 AM
  3. [SOLVED] Run time error 1004 - why is the last line of this code causing this?
    By SweetSorcery in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-14-2014, 06:57 AM
  4. Shared File Causing 1004 Error
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2014, 11:07 PM
  5. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  6. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  7. VisibleItemsList is causing error: 1004
    By kkode in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2012, 05:44 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