Private Sub UserForm_Initialize()
Dim i As Long
Me.ListBox1.Clear
Me.ListBox1.AddItem "File Numbers"
Me.ListBox1.Selected(0) = True
For i = 2 To Sheet1.Range("A10000").End(xlUp).Offset(1, 0).Row - 1
Me.ListBox1.AddItem "File Number" & i + 9999
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = Sheet1.Cells(i, 1).Value
Next i
End Sub
Private Sub CommandButton1_Click()
Dim MyFolder As String, i As Long
MyFolder = Application.GetSaveAsFilename()
Sheet1.Range("A10000").End(xlUp).Offset(1, 0).Value = MyFolder
Me.ListBox1.Clear
Me.ListBox1.AddItem "File Numbers"
Me.ListBox1.Selected(0) = True
For i = 2 To Sheet1.Range("A10000").End(xlUp).Offset(1, 0).Row - 1
Me.ListBox1.AddItem "File Number" & i + 9999
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = Sheet1.Cells(i, 1).Value
Next i
End Sub
Private Sub ListBox1_Click()
On Error Resume Next
Me.AcroPDF1.LoadFile Me.ListBox1.Column(1)
End Sub
Very useful one.........great
ReplyDeleteI get an element not found
ReplyDeleteSuper good effort
ReplyDeleteAcroPDF ko kaise Additional control me add Kare. Element not found ka error de raha hai.
ReplyDeletePlease answer me. Main kaise ise solve Kari.
ReplyDelete