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.

--
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default ListBox and Hyperlinks

Jamie,
Well, all that seams to do is make the ListBox bigger,
but still displays empty.

Have you tried to create a hyper-link to a couple of
spreadsheets and tried this? You will see what I mean.

Thank you for your help

RK


-----Original Message-----
"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/default.asp?

url=/library/en-
us/off2000/html/rerefColumnWidthsProperty.asp

Jamie.

--
.

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default ListBox and Hyperlinks

"RK" wrote ...

Well, all that seams to do is make the ListBox bigger,
but still displays empty.


I thought you may have made one of your columns zero width i.e. not
visible. You did in earlier code:

http://groups.google.com/groups?selm...0a%40p hx.gbl

Me.ListBox1.ColumnWidths = "0;1"

But this is just one of a number of listbox properties that affect
whether columns are visible. Take another look at MSDN.

Have you tried to create a hyper-link to a couple of
spreadsheets and tried this? You will see what I mean.


Yes, the following code works for me:

http://groups.google.com/groups?selm...g .google.com

Jamie.

--
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default ListBox and Hyperlinks

Jamie,
I am not sure why this isn't working. I have deleted all
my code then cut and pasted your code, watching for word
wrap. Compiled the code, no errors. But the problem still
persist. The list box show empty.

??

Thank you for your replys. I am just as confused as
before. It should work.

RK



-----Original Message-----
"RK" wrote ...

Well, all that seams to do is make the ListBox bigger,
but still displays empty.


I thought you may have made one of your columns zero

width i.e. not
visible. You did in earlier code:

http://groups.google.com/groups?selm=c22701c4386e%

24494eb730%24a401280a%40phx.gbl

Me.ListBox1.ColumnWidths = "0;1"

But this is just one of a number of listbox properties

that affect
whether columns are visible. Take another look at MSDN.

Have you tried to create a hyper-link to a couple of
spreadsheets and tried this? You will see what I mean.


Yes, the following code works for me:

http://groups.google.com/groups?

selm=2ed66b75.0406160344.14b90fcb%40posting.google .com

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 07:30 PM.

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

About Us

"It's about Microsoft Excel"