Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default ListBox and Hyperlinks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default ListBox and Hyperlinks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default ListBox and Hyperlinks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ListBox and Hyperlinks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default ListBox and Hyperlinks

"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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default ListBox and Hyperlinks

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default ListBox and Hyperlinks

"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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
listbox B conditional of input in Listbox A Kim K Excel Discussion (Misc queries) 1 October 31st 06 08:27 PM
Hyperlinks in listbox Greg B Excel Discussion (Misc queries) 0 September 3rd 05 01:37 PM
Multicolumn Listbox and ordinary listbox Ron_D Excel Programming 0 June 4th 04 08:56 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


All times are GMT +1. The time now is 05:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"