+ Reply to Thread
Results 1 to 6 of 6

hyperlinks out of a combo box

  1. #1
    Wazooli
    Guest

    hyperlinks out of a combo box

    This is hopfully a simple thing to do. I currently have a list of files as
    choices in a combo box. I would like to be able to hyperlink out to the
    appropriate file when the file is chosen in the combo box. Using the forms
    combo box is a little awkward, and in my primitive way of doing things,
    requires helper cells for the index and hyperlink functions. I know next to
    nothing of VBA, so any help would be appreciated. I would only require an
    example; hopefully, I will be able to modify whatever code is given me to
    suit my needs.

    wazooli

  2. #2
    Tom Ogilvy
    Guest

    Re: hyperlinks out of a combo box

    Why use a hyperlink. why not just have the event code open the workbook
    with the standard Workbooks.Open "C:\MyFile.xls"

    --
    Regards,
    Tom Ogilvy

    "Wazooli" <[email protected]> wrote in message
    news:[email protected]...
    > This is hopfully a simple thing to do. I currently have a list of files

    as
    > choices in a combo box. I would like to be able to hyperlink out to the
    > appropriate file when the file is chosen in the combo box. Using the

    forms
    > combo box is a little awkward, and in my primitive way of doing things,
    > requires helper cells for the index and hyperlink functions. I know next

    to
    > nothing of VBA, so any help would be appreciated. I would only require an
    > example; hopefully, I will be able to modify whatever code is given me to
    > suit my needs.
    >
    > wazooli




  3. #3
    Wazooli
    Guest

    Re: hyperlinks out of a combo box

    Thanks for the reply, and good question. Straight up answer: I didn't know
    I could use Workbooks.Open "C:\MyFile.xls". Like I said, I know nothing
    about VBA. Thanks for the suggestion. The only other question I have is how
    do I translate the choice made in the combo box into what you suggested?

    Wazooli

    "Tom Ogilvy" wrote:

    > Why use a hyperlink. why not just have the event code open the workbook
    > with the standard Workbooks.Open "C:\MyFile.xls"
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Wazooli" <[email protected]> wrote in message
    > news:[email protected]...
    > > This is hopfully a simple thing to do. I currently have a list of files

    > as
    > > choices in a combo box. I would like to be able to hyperlink out to the
    > > appropriate file when the file is chosen in the combo box. Using the

    > forms
    > > combo box is a little awkward, and in my primitive way of doing things,
    > > requires helper cells for the index and hyperlink functions. I know next

    > to
    > > nothing of VBA, so any help would be appreciated. I would only require an
    > > example; hopefully, I will be able to modify whatever code is given me to
    > > suit my needs.
    > >
    > > wazooli

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    Re: hyperlinks out of a combo box

    a dropdown box from the forms toolbar

    Sub Drpdwn_Click()
    sname = Application.Caller
    With Activesheet.DropDowns(sName)
    sFile = .List(.ListIndex)
    End With
    if dir("C:\MyFiles\" & sfile) <> "" then
    workbooks.Open "C:\MyFiles\" & sFile
    else
    msgbox "Bad File name"
    end if
    End Sub

    Assign this macro to the dropdown. Assumes the dropdown contains filenames
    and all file choices are in a single directory.

    --------------

    a combobox from the control toolbox toolbar.


    Private Sub Combobox1_Click()
    if dir ("C:\MyFiles\" & Combobox1.Value) <> "" then
    workbooks.Open "C:\Myfiles\" & Combobox1.Value
    else
    msgbox "File does not exist"
    End if
    End Sub

    It depends on what is in the combobox. I am assuming it has somthing like
    MyFile.xls in the dropdown and all files are in the same directory.



    http://support.microsoft.com/default.aspx?kbid=213749
    XL2000: How to Use a UserForm for Entering Data

    http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
    Lesson 11: Creating a Custom Form
    Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.
    http://j-walk.com/ss/excel/tips/tip84.htm

    http://support.microsoft.com/default...b;en-us;829070
    How to use Visual Basic for Applications examples to control UserForms in
    Microsoft Excel


    http://support.microsoft.com/?id=168067
    File Title: Microsoft(R) Visual Basic(R) for Applications Examples for
    Controlling UserForms in Microsoft Excel 97
    File Name: WE1163.EXE
    File Size: 161742 bytes
    File Date: 05/08/97
    Keywords: kbfile
    Description: This Application Note is an introduction to manipulating
    UserForms in Microsoft Excel 97. It includes examples and Microsoft Visual
    Basic for Applications macros that show you how to take advantage of the
    capabilities of UserForms and use each of the ActiveX controls that are
    available for UserForms

    Peter Aiken Articles:
    Part I
    http://msdn.microsoft.com/library/en...FormsPartI.asp
    Part II
    http://msdn.microsoft.com/library/en...ormsPartII.asp



    "Wazooli" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks for the reply, and good question. Straight up answer: I didn't

    know
    > I could use Workbooks.Open "C:\MyFile.xls". Like I said, I know nothing
    > about VBA. Thanks for the suggestion. The only other question I have is

    how
    > do I translate the choice made in the combo box into what you suggested?
    >
    > Wazooli
    >
    > "Tom Ogilvy" wrote:
    >
    > > Why use a hyperlink. why not just have the event code open the workbook
    > > with the standard Workbooks.Open "C:\MyFile.xls"
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > > "Wazooli" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > This is hopfully a simple thing to do. I currently have a list of

    files
    > > as
    > > > choices in a combo box. I would like to be able to hyperlink out to

    the
    > > > appropriate file when the file is chosen in the combo box. Using the

    > > forms
    > > > combo box is a little awkward, and in my primitive way of doing

    things,
    > > > requires helper cells for the index and hyperlink functions. I know

    next
    > > to
    > > > nothing of VBA, so any help would be appreciated. I would only

    require an
    > > > example; hopefully, I will be able to modify whatever code is given me

    to
    > > > suit my needs.
    > > >
    > > > wazooli

    > >
    > >
    > >




  5. #5
    Wazooli
    Guest

    Re: hyperlinks out of a combo box

    Wow. Thanks so much for the quick fix (hopefully), as well as the online
    resources.

    Wazooli

    "Tom Ogilvy" wrote:

    > a dropdown box from the forms toolbar
    >
    > Sub Drpdwn_Click()
    > sname = Application.Caller
    > With Activesheet.DropDowns(sName)
    > sFile = .List(.ListIndex)
    > End With
    > if dir("C:\MyFiles\" & sfile) <> "" then
    > workbooks.Open "C:\MyFiles\" & sFile
    > else
    > msgbox "Bad File name"
    > end if
    > End Sub
    >
    > Assign this macro to the dropdown. Assumes the dropdown contains filenames
    > and all file choices are in a single directory.
    >
    > --------------
    >
    > a combobox from the control toolbox toolbar.
    >
    >
    > Private Sub Combobox1_Click()
    > if dir ("C:\MyFiles\" & Combobox1.Value) <> "" then
    > workbooks.Open "C:\Myfiles\" & Combobox1.Value
    > else
    > msgbox "File does not exist"
    > End if
    > End Sub
    >
    > It depends on what is in the combobox. I am assuming it has somthing like
    > MyFile.xls in the dropdown and all files are in the same directory.
    >
    >
    >
    > http://support.microsoft.com/default.aspx?kbid=213749
    > XL2000: How to Use a UserForm for Entering Data
    >
    > http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
    > Lesson 11: Creating a Custom Form
    > Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.
    > http://j-walk.com/ss/excel/tips/tip84.htm
    >
    > http://support.microsoft.com/default...b;en-us;829070
    > How to use Visual Basic for Applications examples to control UserForms in
    > Microsoft Excel
    >
    >
    > http://support.microsoft.com/?id=168067
    > File Title: Microsoft(R) Visual Basic(R) for Applications Examples for
    > Controlling UserForms in Microsoft Excel 97
    > File Name: WE1163.EXE
    > File Size: 161742 bytes
    > File Date: 05/08/97
    > Keywords: kbfile
    > Description: This Application Note is an introduction to manipulating
    > UserForms in Microsoft Excel 97. It includes examples and Microsoft Visual
    > Basic for Applications macros that show you how to take advantage of the
    > capabilities of UserForms and use each of the ActiveX controls that are
    > available for UserForms
    >
    > Peter Aiken Articles:
    > Part I
    > http://msdn.microsoft.com/library/en...FormsPartI.asp
    > Part II
    > http://msdn.microsoft.com/library/en...ormsPartII.asp
    >
    >
    >
    > "Wazooli" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks for the reply, and good question. Straight up answer: I didn't

    > know
    > > I could use Workbooks.Open "C:\MyFile.xls". Like I said, I know nothing
    > > about VBA. Thanks for the suggestion. The only other question I have is

    > how
    > > do I translate the choice made in the combo box into what you suggested?
    > >
    > > Wazooli
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > Why use a hyperlink. why not just have the event code open the workbook
    > > > with the standard Workbooks.Open "C:\MyFile.xls"
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > "Wazooli" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > This is hopfully a simple thing to do. I currently have a list of

    > files
    > > > as
    > > > > choices in a combo box. I would like to be able to hyperlink out to

    > the
    > > > > appropriate file when the file is chosen in the combo box. Using the
    > > > forms
    > > > > combo box is a little awkward, and in my primitive way of doing

    > things,
    > > > > requires helper cells for the index and hyperlink functions. I know

    > next
    > > > to
    > > > > nothing of VBA, so any help would be appreciated. I would only

    > require an
    > > > > example; hopefully, I will be able to modify whatever code is given me

    > to
    > > > > suit my needs.
    > > > >
    > > > > wazooli
    > > >
    > > >
    > > >

    >
    >
    >


  6. #6
    Wazooli
    Guest

    Re: hyperlinks out of a combo box

    and, P.S. - the second snippet of code works fantastically. thanks again.

    wazooli

    "Tom Ogilvy" wrote:

    > a dropdown box from the forms toolbar
    >
    > Sub Drpdwn_Click()
    > sname = Application.Caller
    > With Activesheet.DropDowns(sName)
    > sFile = .List(.ListIndex)
    > End With
    > if dir("C:\MyFiles\" & sfile) <> "" then
    > workbooks.Open "C:\MyFiles\" & sFile
    > else
    > msgbox "Bad File name"
    > end if
    > End Sub
    >
    > Assign this macro to the dropdown. Assumes the dropdown contains filenames
    > and all file choices are in a single directory.
    >
    > --------------
    >
    > a combobox from the control toolbox toolbar.
    >
    >
    > Private Sub Combobox1_Click()
    > if dir ("C:\MyFiles\" & Combobox1.Value) <> "" then
    > workbooks.Open "C:\Myfiles\" & Combobox1.Value
    > else
    > msgbox "File does not exist"
    > End if
    > End Sub
    >
    > It depends on what is in the combobox. I am assuming it has somthing like
    > MyFile.xls in the dropdown and all files are in the same directory.
    >
    >
    >
    > http://support.microsoft.com/default.aspx?kbid=213749
    > XL2000: How to Use a UserForm for Entering Data
    >
    > http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
    > Lesson 11: Creating a Custom Form
    > Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.
    > http://j-walk.com/ss/excel/tips/tip84.htm
    >
    > http://support.microsoft.com/default...b;en-us;829070
    > How to use Visual Basic for Applications examples to control UserForms in
    > Microsoft Excel
    >
    >
    > http://support.microsoft.com/?id=168067
    > File Title: Microsoft(R) Visual Basic(R) for Applications Examples for
    > Controlling UserForms in Microsoft Excel 97
    > File Name: WE1163.EXE
    > File Size: 161742 bytes
    > File Date: 05/08/97
    > Keywords: kbfile
    > Description: This Application Note is an introduction to manipulating
    > UserForms in Microsoft Excel 97. It includes examples and Microsoft Visual
    > Basic for Applications macros that show you how to take advantage of the
    > capabilities of UserForms and use each of the ActiveX controls that are
    > available for UserForms
    >
    > Peter Aiken Articles:
    > Part I
    > http://msdn.microsoft.com/library/en...FormsPartI.asp
    > Part II
    > http://msdn.microsoft.com/library/en...ormsPartII.asp
    >
    >
    >
    > "Wazooli" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks for the reply, and good question. Straight up answer: I didn't

    > know
    > > I could use Workbooks.Open "C:\MyFile.xls". Like I said, I know nothing
    > > about VBA. Thanks for the suggestion. The only other question I have is

    > how
    > > do I translate the choice made in the combo box into what you suggested?
    > >
    > > Wazooli
    > >
    > > "Tom Ogilvy" wrote:
    > >
    > > > Why use a hyperlink. why not just have the event code open the workbook
    > > > with the standard Workbooks.Open "C:\MyFile.xls"
    > > >
    > > > --
    > > > Regards,
    > > > Tom Ogilvy
    > > >
    > > > "Wazooli" <[email protected]> wrote in message
    > > > news:[email protected]...
    > > > > This is hopfully a simple thing to do. I currently have a list of

    > files
    > > > as
    > > > > choices in a combo box. I would like to be able to hyperlink out to

    > the
    > > > > appropriate file when the file is chosen in the combo box. Using the
    > > > forms
    > > > > combo box is a little awkward, and in my primitive way of doing

    > things,
    > > > > requires helper cells for the index and hyperlink functions. I know

    > next
    > > > to
    > > > > nothing of VBA, so any help would be appreciated. I would only

    > require an
    > > > > example; hopefully, I will be able to modify whatever code is given me

    > to
    > > > > suit my needs.
    > > > >
    > > > > wazooli
    > > >
    > > >
    > > >

    >
    >
    >


+ 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