+ Reply to Thread
Results 1 to 8 of 8

userform to search multiple worksheets

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    userform to search multiple worksheets

    hi
    how would i go about searching for data in 2 worksheets , i have a userform that collecta data from sheet1 it has text boxes these work,it also has a combobox
    that populates from same sheet , i need to populate another combobox from a different sheet4 , how do i initialise both worksheets please
    ws=sheet1(mfr_list") & ws=sheet4("sheet1") do these 2 commands go at the top or where please
    cheers colin

  2. #2
    Registered User
    Join Date
    07-25-2005
    Location
    Leeds, UK
    MS-Off Ver
    2010
    Posts
    12

    Re: userform to search multiple worksheets

    Hi Colin,

    Are you trying to reference a number of different worksheets

    If I've read your post correctly you'll be after something like...

    Option Explicit
    
    Private Sub FindDataOnDifferentSheets()
    Dim WS1 As Worksheet, WS2 As Worksheet
    
    Set WS1 = ThisWorkbook.Sheets("Sheet1")
    Set WS2 = ThisWorkbook.Sheets("Sheet2")
    
    Debug.Print WS1.Range("A:A").Find(100).Address
    Debug.Print WS2.Range("A:A").Find(200).Address
    
    Set WS1 = Nothing
    Set WS2 = Nothing
    End Sub
    If this isn't what your after let me know and with a bit more information I may be able to help?

    Cheers

  3. #3
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: userform to search multiple worksheets

    hi
    looks something like, what is the print part of it, i have a userform with 2 comboboxes1 and 2, cmb1 looks up sheet and cmb2 looks up sheet4 and populates userform than i send it all to sheet 3 , the comboboxes just give me choice selections while textboxes are populated by choices,
    hope that explains will try out your suggestion in few mins
    cheers colin
    Last edited by cfinch100; 01-02-2013 at 05:45 PM.

  4. #4
    Registered User
    Join Date
    07-25-2005
    Location
    Leeds, UK
    MS-Off Ver
    2010
    Posts
    12

    Re: userform to search multiple worksheets

    The debug.print is just a way to return a result to the immediate window (CTRL+G to view).

    You should be able to use the above code to link to your combobox...

    cmb1.additem  WS1.Range("A:A").Find(100).Address
    You obviously change what is being populated into cmb1 however.

    Hope this helps?

  5. #5
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: userform to search multiple worksheets

    hi
    will try to enter this morrow and let you know morrow nite just got called out to work
    many thanks
    cheers colin

  6. #6
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: userform to search multiple worksheets

    hi
    have tried this and can not get it to work could be putting it in wrong place
    cheers colin

  7. #7
    Registered User
    Join Date
    07-25-2005
    Location
    Leeds, UK
    MS-Off Ver
    2010
    Posts
    12

    Re: userform to search multiple worksheets

    Can you upload your code or an example workbook?

  8. #8
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: userform to search multiple worksheets

    hi
    workbook here its userform 1 thats the problem crane size looks up sheet "prices" its the driver combo that should look up "sheet1"
    think im getting me self in a mess as usual
    cheers colin
    Attached Files Attached Files
    Last edited by cfinch100; 01-03-2013 at 08:51 AM.

+ 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