Hi Ross,
Thanks a lot for your reply, I had incorporated the code provided by you in your earlier post in my download tool macro but it is showing an compile error. Attached is my download tool macro file for your reference.
Apart from this I have identified one more issue in my macro .i.e. when I try to remove a URL from the listbox by selecting the same and clicking on remove button it gets only removed from the listbox but not from the excel sheet. It should ideally remove the selected listbox item from excel sheet as well and should ask first before removing the item from the listbox .i.e. a confirmation from user with a prompt .i.e. "Are you sure you want to remove this item".
I have got the below code from the extensive google search for deleting items from listbox (which will also delete the items from excel sheet but some how when I am trying to incorporate the below code in my macro it doesn't work. Please help.
Private Sub cmdDel_Click()
With UserForm1.ListBox1
'Check for selected item
If (.Value <> vbNullString) Then
'If more then one data rows
If (.ListIndex >= 0 And xlLastRow("Sheet1") > 2) Then
Range(.RowSource)(.ListIndex + 1, 1).EntireRow.Delete
'Update listbox
.RowSource = "Sheet1!A2:C" & xlLastRow("Sheet1")
'If only one data row
ElseIf (.ListIndex = 0 And xlLastRow("Sheet1") = 2) Then
Range(.RowSource)(.ListIndex + 1, 1).EntireRow.Delete
'Update listbox
.RowSource = "Sheet1!A2:C2"
End If
Else
MsgBox "Please Select Data"
End If
End With
End Sub
Apart from this I want to rename the downloaded files as per the names present against each link in the column B.
Thanks a lot for your help in advance.
Bookmarks