Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone help me? ?? MVP ???
For two months I have posted and I still don't have an answer. How can I do a listBox with Hyper-links? I can do it with other lists both through the wizard or VB, but have been unsuccessful with hyper-links, all that is displayed is the friendly name or nothing at all! Is there an example out there that I can look at? I haven't found anything on the Web or Microsoft. Before posting, please try it for yourself. I have had comments that "try this, (example)" this should work, but it hasn't. The examples do work on normal lists. Thank you for your help. RK |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What would be the purpose of a listbox with hyperlinks?
-- Vasant "RK" wrote in message ... Can anyone help me? ?? MVP ??? For two months I have posted and I still don't have an answer. How can I do a listBox with Hyper-links? I can do it with other lists both through the wizard or VB, but have been unsuccessful with hyper-links, all that is displayed is the friendly name or nothing at all! Is there an example out there that I can look at? I haven't found anything on the Web or Microsoft. Before posting, please try it for yourself. I have had comments that "try this, (example)" this should work, but it hasn't. The examples do work on normal lists. Thank you for your help. RK |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 35+ spreadsheets, that based on the year and the
Quarter, I would be able to select the Hyper-link to the spreadsheet and send data to that particular spreadsheet to print. RK -----Original Message----- What would be the purpose of a listbox with hyperlinks? -- Vasant "RK" wrote in message ... Can anyone help me? ?? MVP ??? For two months I have posted and I still don't have an answer. How can I do a listBox with Hyper-links? I can do it with other lists both through the wizard or VB, but have been unsuccessful with hyper-links, all that is displayed is the friendly name or nothing at all! Is there an example out there that I can look at? I haven't found anything on the Web or Microsoft. Before posting, please try it for yourself. I have had comments that "try this, (example)" this should work, but it hasn't. The examples do work on normal lists. Thank you for your help. RK . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A listbox has a click event and in that event you can do whatever you want
with the item(s) selected in the listbox. The listbox doesn't support a hyperlink per se, but using the click event, as I said, you should be able to do what you describe. And yes, I have done similar. -- Regards, Tom Ogilvy "RK" wrote in message ... I have 35+ spreadsheets, that based on the year and the Quarter, I would be able to select the Hyper-link to the spreadsheet and send data to that particular spreadsheet to print. RK -----Original Message----- What would be the purpose of a listbox with hyperlinks? -- Vasant "RK" wrote in message ... Can anyone help me? ?? MVP ??? For two months I have posted and I still don't have an answer. How can I do a listBox with Hyper-links? I can do it with other lists both through the wizard or VB, but have been unsuccessful with hyper-links, all that is displayed is the friendly name or nothing at all! Is there an example out there that I can look at? I haven't found anything on the Web or Microsoft. Before posting, please try it for yourself. I have had comments that "try this, (example)" this should work, but it hasn't. The examples do work on normal lists. Thank you for your help. RK . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"RK" wrote ...
I have 35+ spreadsheets, that based on the year and the Quarter, I would be able to select the Hyper-link to the spreadsheet and send data to that particular spreadsheet to print. Try this general approach: capture the workbook name and folder with: cell.Hyperlinks(1).Address and the range with: cell.Hyperlinks(1).SubAddress and use this info to open the workbook, 'send' the data to the range and print it out. Before posting, please try it for yourself. I have had comments that "try this, (example)" this should work, but it hasn't. Fair enough: Option Explicit Private Sub UserForm_Initialize() Dim cell As Range Me.ListBox1.ColumnCount = 2 Me.ListBox1.BoundColumn = 1 For Each cell In Sheet1.Range("AC2:AC69").Cells Me.ListBox1.AddItem cell.Hyperlinks(1).Address Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = _ cell.Hyperlinks(1).SubAddress Next cell End Sub Private Sub CommandButton2_Click() Dim i As Long Dim wb As Excel.Workbook Dim ws As Excel.Worksheet Dim rng As Excel.Range For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then Set wb = Application.Workbooks.Open(ListBox1.List(i, 0)) Set ws = wb.Worksheets(Left$(ListBox1.List(i, 1), _ InStr(ListBox1.List(i, 1), "!") - 1)) Set rng = ws.Range(Mid$(ListBox1.List(i, 1), _ InStr(ListBox1.List(i, 1), "!") + 1)) With rng .Value = 99 .PrintOut End With End If Next i End Sub Jamie. -- |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for your reply,
The problem that I still have, is that the list box is blank. ? ? ? I still don't understand why. And I have looked for examples on the Internet without any success. Thank you again for your reply. RK -----Original Message----- "RK" wrote ... I have 35+ spreadsheets, that based on the year and the Quarter, I would be able to select the Hyper-link to the spreadsheet and send data to that particular spreadsheet to print. Try this general approach: capture the workbook name and folder with: cell.Hyperlinks(1).Address and the range with: cell.Hyperlinks(1).SubAddress and use this info to open the workbook, 'send' the data to the range and print it out. Before posting, please try it for yourself. I have had comments that "try this, (example)" this should work, but it hasn't. Fair enough: Option Explicit Private Sub UserForm_Initialize() Dim cell As Range Me.ListBox1.ColumnCount = 2 Me.ListBox1.BoundColumn = 1 For Each cell In Sheet1.Range("AC2:AC69").Cells Me.ListBox1.AddItem cell.Hyperlinks(1).Address Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = _ cell.Hyperlinks(1).SubAddress Next cell End Sub Private Sub CommandButton2_Click() Dim i As Long Dim wb As Excel.Workbook Dim ws As Excel.Worksheet Dim rng As Excel.Range For i = 0 To Me.ListBox1.ListCount - 1 If Me.ListBox1.Selected(i) Then Set wb = Application.Workbooks.Open(ListBox1.List(i, 0)) Set ws = wb.Worksheets(Left$(ListBox1.List(i, 1), _ InStr(ListBox1.List(i, 1), "!") - 1)) Set rng = ws.Range(Mid$(ListBox1.List(i, 1), _ InStr(ListBox1.List(i, 1), "!") + 1)) With rng .Value = 99 .PrintOut End With End If Next i End Sub Jamie. -- . |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"RK" wrote ...
The problem that I still have, is that the list box is blank. ? ? ? I still don't understand why. And I have looked for examples on the Internet without any success. Try he http://msdn.microsoft.com/library/de...hsProperty.asp Jamie. -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
listbox B conditional of input in Listbox A | Excel Discussion (Misc queries) | |||
Hyperlinks in listbox | Excel Discussion (Misc queries) | |||
Multicolumn Listbox and ordinary listbox | Excel Programming | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
Is refreshing listbox rowsource in listbox click event possible? | Excel Programming |