• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Type to filter after sort not working

Juzar22

Member
Hi All,

I have an excel file where type to filter search box VBA is running, when i sort the data then type to filter box is not responding and complete sheet is getting highlighted , can you please fix this problem. Thanks

Find attached both files after sort and before sort.
 

Attachments

  • Office After sort..xlsm
    432.5 KB · Views: 5
  • Office before sort.xlsm
    437.8 KB · Views: 8
I would suggest that in all your event subroutine you desable events

Application.EnableEvents = False
Your code
Application.EnableEvents = True
 
vletm
Please find the attached file i inserted the code but still type to filter search box is not working
 

Attachments

  • Office file 2.xlsm
    433.1 KB · Views: 2
Juzar22
I can only select Your 'TextBox1' ( not type there anything ).
... why do You have that 'TextBox1' at all?

Testbox1, has filter as you type code.
check attached file before sort their is no issues. where testbox1 is working for example if you type S 500 you can see the filter.
 

Attachments

  • Office before sort.xlsm
    437.8 KB · Views: 0
When I sort the file for example by column E 'Model' then , search box is not working and screen freezes.
It seems that if a sort is in place in the autofilter it really does screw things up when the filter is re-applied.
I've added a line to clear the sort (after sorting) from the autofiltered range. The order won't be changed but the little sort arrow will disappear, no longer telling you that's how it's been sorted. The changes are in the attachment to msg#12 there (https://chandoo.org/forum/threads/text-box-search-filter.43218/post-261098). The change is:
Code:
  With Me.ListObjects("states").AutoFilter
    .Sort.SortFields.Clear
    .ApplyFilter
  End With
(I'm not going to revisit the code in the files you attached in this thread).
 
Thanks for the Code but it sorts complete sheet i only want to sort the visible row in filtered sheet for example if data is filtered with Column E / Model / C 200, then i want to sort the data by Column B / WIP NO , is it possible. Thanks
 
Last edited by a moderator:
i only want to sort the visible row in filtered sheet
That'd be hard work! I'm not doing it.
for example if data is filtered with Column E / Model / C 200, then i want to sort the data by Column B / WIP NO , is it possible.
The whole table will be sorted as you want, filtered and visible data with it, of course. What difference does it make if the invisible rows are also sorted? You can sort again on other columns with a click of a mouse. Maybe I'm missing something.
 
That'd be hard work! I'm not doing it.
The whole table will be sorted as you want, filtered and visible data with it, of course. What difference does it make if the invisible rows are also sorted? You can sort again on other columns with a click of a mouse. Maybe I'm missing something.

Thank You , Well Noted !!
 
Back
Top