+ Reply to Thread
Results 1 to 9 of 9

linking a list item or text item in a user form to a worksheet

  1. #1
    Registered User
    Join Date
    07-16-2010
    Location
    CO
    MS-Off Ver
    Excel 2003
    Posts
    18

    linking a list item or text item in a user form to a worksheet

    I'm looking to find a way to link a worksheet to a list item in a list box or a item in a text box. The list box or text bow will have multiple items that each need to link to other worksheets. This list box or text box is being used within a user form. From what i understand, using the rowsource property of the list box will not allow me to use the addItem property. I'd be willing to use either a text box or list box for this.Thanks so much for any help you can give.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: linking a list item or text item in a user form to a worksheet

    Not sure what you mean. Try attaching an example & a clearer explanation
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-29-2010
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: linking a list item or text item in a user form to a worksheet

    I created an example of what I think you are shooting for and placed it at

    http://www.HelpExcel.com/ExcelForum/LinkLB.xlsm
    Regards,
    Eddie

  4. #4
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: linking a list item or text item in a user form to a worksheet

    Hi ravergirl7216;

    What do you mean by "linked to a worksheet"? Do you mean you want a list of all the worksheets in the workbook? Do you mean that when you select an item in the Listbox that the sheet it is linked to will be activated? Or what?

    What happens when you select an item in the Listbox?
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  5. #5
    Registered User
    Join Date
    07-16-2010
    Location
    CO
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: linking a list item or text item in a user form to a worksheet

    I have a list box that has items in it. I want those items inthe list box individually to link to a worksheet within a workbook. I want the user form where the listbox resides to close and open up a worksheet.

  6. #6
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: linking a list item or text item in a user form to a worksheet

    Hi ravergirl7216;

    OK, to make sure I'm on the same page with you. You want a Listbox with all the sheet names listed, and when you select one of the sheets listed in the Listbox you want the userform to close and Activate the sheet selected in the Listbox.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-16-2010
    Location
    CO
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: linking a list item or text item in a user form to a worksheet

    sorry. I'm trying to be clear about what I need. I don't want to post the workbook because it may get confusing but,.... I think we're getting closer. I have a user form that, after using option buttons, delivers results to a text box (which was a list box earlier) and these results (it may be one or three items) must "each individually" link to a worksheet when you click or select it. I've gotten code that links the textbox itself to a worksheet. but what i need is the code to link what is inside the text box to a worksheet. So if the text box has apple, it would link to a worksheet named apple, and if orange was in the text box in would link to a worksheet called orange. When you click on apple in the listbox, it would go to it;s corresponding worksheet. Maybe I'm using the wrong box. Maybe I should switch to a combo box?

  8. #8
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: linking a list item or text item in a user form to a worksheet

    Hi ravergirl7216;

    Try this:

    Sub Listbox1_Click()
    Dim sh As Worksheet

    On Error Resume Next
    Set sh = Worksheets(Listbox1.Value)
    On Error Goto 0

    If Not sh Is Nothing Then
    sh.Activate
    End If
    End Sub

  9. #9
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: linking a list item or text item in a user form to a worksheet

    Hi ravergirl7216;

    Try this:
    Please Login or Register  to view this content.

+ 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