how to ad text infront of existing data in a cell

primatex

New Member
Joined
Nov 28, 2005
Messages
1
Hello I am very new with excel 2000 ,I am running windows xp pro. I have a file that has a column with say heading "product pics" each cell has a different image name.

example....
pic1.jpg
pic2.jpg
pic3.jpg

and i need to past a path infront of about 500 cells in that column. I know i can paste each cell but this would take a long time. I need it to be like...

example....
www.anysite.com/imagesfolder/pic1.jpg
www.anysite.com/imagesfolder/pic2.jpg
www.anysite.com/imagesfolder/pic3.jpg

I am looking for a way to past the whole column at once. can any one tell me how to do this . Please be very detailed if you can since i am very new with excel 2000.

Thx in advance for any help!!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi,

Welcome to MrExcel!

This macro would do the trick.

Code:
Sub InsertPath()
    For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
        If Cells(i, 1) <> "" Then Cells(i, 1) = "www.anysite.com/imagesfolder/" & Cells(i, 1)
    Next i
End Sub

To run this macro:

1. Hit Alt+F11
2. Insert a Module
3. Paste this code
4. Close the window

Now go to Tools->Macro->Macros

Click Run.

HTH
 
Upvote 0
Welcome to the board!

Here's another way without using a macro if that is preferable for you:
Book1
ABCD
1www.anysite.com/imagefolder/pic1.jpgwww.anysite.com/imagefolder/pic1.jpg
2www.anysite.com/imagefolder/pic2.jpgwww.anysite.com/imagefolder/pic2.jpg
3www.anysite.com/imagefolder/pic3.jpg[url]www.anysite.com/imagefolder/pic3.jpg[/url]
4
Sheet1


Type in the whole address except the pic name in A1 and use the fill handle to fill down to the last picture stored in column B.

Copy the formula in C1 and fill down.

Select all the filled cells in column C and right-click, select Hyperlink. Click on Existing File or Web Page and type in your Web address in the Address field. Click OK (or Enter).

Edit: As you can see if you place the curser on the link in C1 the actual Web address can be other than the displayed address.

Edit 2: You can now hide column A and B for the look of it.

HTH (Hope This Helps)

RAM
 
Upvote 0

Forum statistics

Threads
1,203,667
Messages
6,056,647
Members
444,879
Latest member
suzndush

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