Adding a string to excel data. . .

Koenigsegg

Banned
Jun 29, 2005
2,267
1
0
I have a spreadsheet with file names that I want to add ".jpg" to. There's 1300 entries, in the form of something like adv_1356, so I want it to say adv_1356.jpg

I found this but that wants to add a 6 number string, and I'm not sure how to modify it otherwise. . .
 

Thyme

Platinum Member
Nov 30, 2000
2,330
0
0
If it's just one column, the easiest solution would be to just use a formula and fill it down.
 

Concillian

Diamond Member
May 26, 2004
3,751
8
81
Say the data you're interested in changing is in cloumn D rows 1 - 1300

make a blank column next to your data (column E)
in the first cell of that column (E1) put the following formula:

=concatenate(d1,".jpg")

autofill down
copy column E
highlight column D
edit --> paste special...
then choose 'values'
now delete column E

That macro would actually work also, there is nothing special about it that seems to check that it's 6 digits long, or even a number. The only part that mentions the length of the string is the inputbox. It basically does (automatically) what I just explained. If you need to do this once, then do what I explained. If you need to do this on a regular basis, use the macro, but change the comment on the inputbox function to read whatever you want the user to see (change the part that reads "Enter the 6 number string to be appended to Column A" to read "<Whatever you want the user to see>" )
 

Shagga

Diamond Member
Nov 9, 1999
4,421
0
76
You could just do as Thyme says. This is the easiest I would have thought. For example

A1

Adv_1356

In B1 type =A1 &".jpg"

Just copy the formula in B1 to B2, B3,B4 etc

[edit]

Or even as Concillian says. LOL :D
 

moretoys

Member
Nov 21, 2000
133
0
0
I agree with the concat concensus. If you can't mess with the column structure, just do it on a seperate sheet, copy the results and use paste special, text only to put the new names in the proper column.