+ Reply to Thread
Results 1 to 12 of 12

VBA code needed to show the results through UserForm

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question VBA code needed to show the results through UserForm

    Folks,

    I have a workbook with two data sheets and three user forms. The first userform (“MainForm”) for user to select the search criteria and second and third userform for viewing the details based on the Search Criteria selected in MainForm, I am unable to set the offset cell value into ComboBox and Text Box from the data sheets. Can you please help me to fix the issues? I have attached the excel file of what I'm trying to accomplish.

    Thanks in advance for your expertise!

    Joshi
    Attached Files Attached Files
    Last edited by krjoshi; 12-01-2012 at 12:53 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA code needed to show the results through UserForm

    Hi Joshi

    You have duplicate records in the Flange_Blind Worksheet (see S_No 510 and 511 for example). How does one know for which to pull details?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA code needed to show the results through UserForm

    Hi John,

    Thanks for your reply. No, they are not duplicated records, please note that the column F "PIPING CLASS" values are different.

    Please help me to fix the userforms?

    Thanks in advance,

    Joshi

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA code needed to show the results through UserForm

    Hi Joshi

    I've looked at the file again this AM...see attached jpg
    Duplicates.jpg

  5. #5
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA code needed to show the results through UserForm

    Hi John,

    Sorry, that record I pasted mistakenly. Please ignore the duplicate record. Can you please help me to fix the userform issues?

    Thanks in advance,
    Joshi

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA code needed to show the results through UserForm

    Hi Joshi

    Either the file will or will not contain duplicates. If it does, they need to be dealt with. You explained it was a copy/paste error on the previous example...so be it...Fix it.

    In this example (the Spade Worksheet) you have duplicate records for Columns B, E and F, the Columns you're selecting on. However, in this example the SAP Code is different. So, my question is..."What's reality???"

    Another Dup Issue.jpg

    Should the Code handle Duplicate Records? Should SAP Code also be a Selection Criteria?

  7. #7
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question Re: VBA code needed to show the results through UserForm

    Hi John,
    SAP Code not a selection criterion, SPADE SIZE is my first criteria. Never show the duplicated reords. I have attached a sample sheet for my results.

    Please check and advise.

    Joshi
    Attached Files Attached Files

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA code needed to show the results through UserForm

    Hi Joshi

    Try the code in the attached.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA code needed to show the results through UserForm

    Hi John,
    You are a real GURU, Excellent code and it working great. Thank you so much. One small doubt there is a blank text box in each subform, is it really required to run the codes? if yes can you tell me how it works?

    Sorry for bothering.

    Joshi

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA code needed to show the results through UserForm

    Hi Joshi

    I assume you're referring to TextBox1 on the subforms. Those Textboxes are hidden but are being populated by the S_No. They're not currently being used and could probably be deleted. Were I you I'd leave them...you may want them in the future.

  11. #11
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: VBA code needed to show the results through UserForm

    Hi John,
    Thank you so much once again.

    Joshi

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA code needed to show the results through UserForm

    Hi Joshi

    You're welcome...glad I could help. Thanks for the Rep.

+ 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