View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
RK[_2_] RK[_2_] is offline
external usenet poster
 
Posts: 25
Default Frustrated - List Box

Insert Hyperlink.

I will try this and let you know.
Thank you for your help

RK



-----Original Message-----
RK

How did you create the hyperlinks? Insert - Hyperlink

or HYPERLINK
worksheet formula? If the former, try something like

this

Private Sub CommandButton1_Click()

Dim i As Long

For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) Then
Range(Me.ListBox1.List(i)).Parent.PrintOut
End If
Next i

End Sub

Private Sub UserForm_Initialize()

Dim cell As Range

Me.ListBox1.ColumnCount = 2
Me.ListBox1.BoundColumn = 1
Me.ListBox1.ColumnWidths = "0;1"

For Each cell In Sheet1.Range("A2:A11").Cells
Me.ListBox1.AddItem cell.Hyperlinks(1).SubAddress
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) =
cell.Hyperlinks(1).TextToDisplay
Next cell
End Sub

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

wrote:
No, I would like to print the spreadsheet that the
hyperlink refers to.

I have 40 spreadsheets, of them I have 35 that I need

to
print, based on a table I created. What spreadsheet is
printed is based on year and quarter.
I created (see code) a listing of all the spreadsheets

and
with checkboxes that I can select one, two, or more and
then I can print that selection. The problem I have is
this:

2004 1st Qtr = sheet4
2004 2nd Qtr = sheet17
2004 3rd qtr = sheet29, etc.

depending on the year and quarter the spreadsheet

changes.

So I created a hyperlink to correspond to the correct
worksheet.

If I use a listbox for the Hyperlink, I only shows the
frendly name and selecting that doesn't go to the

sheet,
nor can I print the sheet.

What I am trying to do is to create a list box with
checkboxes, that show the friendly name of the

hyperlink
and when selected, when I hit my cmdPrintButton, it

would
print those sheets.

Excel programming is new to me, but what I have created
so far works very well.

Thank you for your help.

RK


-----Original Message-----
RK


But what I need to do is. . .
On ( sheet1,Column AC )
is a listing of Hyperlinks that I would like to do

the
the same way. List in my list box and with a check

box
be able to select one or more then hit my print

button
that I created.

You want to print hyperlinks?

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com


.



.