+ Reply to Thread
Results 1 to 2 of 2

Search for item in multipage and show the item on the specific page + Collection

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-13-2017
    Location
    Buchares
    MS-Off Ver
    2016
    Posts
    117

    Search for item in multipage and show the item on the specific page + Collection

    Hey guys, I'm trying to create and advanced search while having a collection of items / buttons displayed on different pages from a multipage. I've extracted the bare minimum of the entire code in order to be able to share the workbook.

    My problem is that i don't know how to do this idea : for example of items test 1 to....test 30 if i seach for test 6 and he is located on the second page from the multipage, the first page to dissapear / invisible and the item should become the first arranged.

    Picture one with all the data , and picture 2 with the simulated result.

    I've made the textbox_Change() but...now what?

    Thank you for your time
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: [Hard] Search for item in multipage and show the item on the specific page + Collectio

    Would this piece of code for the search box take you in the direction you want?
    Needs some additions.
    Private Sub search_for_someone_Change()
    Dim ctr As Object, btn As MSForms.CommandButton, part
    'here is the problem
    For Each ctr In Me.Controls 'Loop to all the controls in the form
        If TypeOf ctr Is CommandButton Then 'Check if it's a button
            Set btn = ctr
            Select Case ctr.Name
                Case "buton_office_model", "buton_executie_model"
                    'Skip
                Case Else
    '                Debug.Print ctr.Name & ": " & btn.Caption & " on " & ctr.Parent.Name
                    part = Split(btn.Caption, ":") 'Split the name and the function
                    If InStr(1, part(0), Me.search_for_someone) > 0 Or _
                        InStr(part(1), Me.search_for_someone) > 0 Then 'Check if the button matches the search criteria
                        ctr.Visible = True 'If match show the button
                    Else
                        ctr.Visible = False 'If no match hide the button
                    End If
            End Select
        End If
    Next ctr
    Set btn = Nothing
    
    End Sub
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

+ 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. Replies: 4
    Last Post: 12-31-2018, 02:42 PM
  2. [SOLVED] search for a specific item, return related data
    By jrhelp in forum Excel General
    Replies: 11
    Last Post: 07-21-2018, 03:44 PM
  3. Replies: 2
    Last Post: 12-14-2016, 12:20 AM
  4. UserForm: Search Item in List > Call Table associated with Item > Execute Command
    By TexasAggie12 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2014, 12:58 PM
  5. Replies: 2
    Last Post: 08-02-2013, 08:04 AM
  6. how to search the transactions for a particular item in a specific time?
    By Zecond in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 07-22-2013, 09:38 PM
  7. Adding an item to a specific collection tree
    By stuart010 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-29-2013, 10:08 AM

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