Pull file names from list of URLs

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Kenichi,


Excel Workbook
AB
1http://images.site.com/dd/ds/38232-01.jpg38232-01.jpg
2http://images.site.com/adg/FD02_01.gifFD02_01.gif
3http://images.site.com/cc/we/234294-DS.png234294-DS.png
4http://images.site.com/qwe/129382.jpg129382.jpg
5
Sheet1





The formula in cell B1 copied down:
=TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",100)),100))

 
Upvote 0
Kenichi,

If you are looking for a macro solution:


Sampe raw data before the macro:


Excel Workbook
A
1http://images.site.com/dd/ds/38232-01.jpg
2http://images.site.com/adg/FD02_01.gif
3http://images.site.com/cc/we/234294-DS.png
4http://images.site.com/qwe/129382.jpg
5
Sheet1





After the macro:


Excel Workbook
A
138232-01.jpg
2FD02_01.gif
3234294-DS.png
4129382.jpg
5
Sheet1





Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
2. Open your workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


Code:
Option Explicit
Sub PullFileName()
' hiker95, 05/28/2011
' http://www.mrexcel.com/forum/showthread.php?t=553493
Dim F As Variant, a As Long
Application.ScreenUpdating = False
F = Range("A1", Range("A" & Rows.Count).End(xlUp))
For a = LBound(F) To UBound(F)
  F(a, 1) = Trim(Right(Application.Substitute(F(a, 1), "/", Application.Rept(" ", 100)), 100))
Next a
Columns(1).ClearContents
Range("A1").Resize(UBound(F)).Value = F
Columns(1).AutoFit
Application.ScreenUpdating = True
End Sub


Then run the PullFileName macro.
 
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top