Thread: Change Macro?
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Alen32 Alen32 is offline
external usenet poster
 
Posts: 78
Default Change Macro?

I got this macro here which works well:
Private Sub ListBox1_Change()
With Me.ListBox1
If .ListIndex -1 Then
'MsgBox .List(.ListIndex, 1)
ThisWorkbook.FollowHyperlink _
Address:="Http://" & .List(.ListIndex, 1)
End If
End With
End Sub

Private Sub UserForm_Initialize()
Dim cell As Range
Dim sh As Worksheet

With Me
.ListBox1.RowSource = ""
.ListBox1.ColumnCount = 3
.ListBox1.Clear
End With

Set sh = Worksheets("Ark1")

For Each cell In sh.Range("A10:A250")
If cell.Value = sh.Range("A5").Value Then
With UserForm
.ListBox1.AddItem cell.Value
.ListBox1.List(.ListBox1.ListCount - 1, 1) _
= cell.Offset(0, 2).Value
.ListBox1.List(.ListBox1.ListCount - 1, 2) _
= cell.Offset(0, 5).Value
End With
End If
Next

End Sub


I want to change macro becauseof this:
I have made Useform with 2 frame and inside of each frame two option
button. I have also one textbox.
At the end I have one commandbutton (FIND). I want to do this:
When USER make choise in this two frames and make input in textbox. And
push commanbutton(FIND) then if this 3 words appear in samme row then I
want row display in listbox. It sholud be searched in a whole workbook.