ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Adding to a group of text. (https://www.excelbanter.com/excel-discussion-misc-queries/123417-adding-group-text.html)

ChrisB

Adding to a group of text.
 
I have about 5000 words in columns, I want to add a IMG extension on
these columns, cant his be achieved? for example:

1 WORD
2 PLAY
3 GAME


I would lke to add .JPG on the end of each of those words, all the way
down for 5,000 products, can this be done, and if so, how?

thanks in advance


Dave O

Adding to a group of text.
 
In an adjacent column, enter the formula
=A1&".jpg"
where A1 contains WORD, etc. You can then copy the formulas and paste
them back over themselves as text, if you need/want to.


David Biddulph

Adding to a group of text.
 
=A1&".JPG"
--
David Biddulph

"ChrisB" wrote in message
oups.com...
I have about 5000 words in columns, I want to add a IMG extension on
these columns, cant his be achieved? for example:

1 WORD
2 PLAY
3 GAME


I would lke to add .JPG on the end of each of those words, all the way
down for 5,000 products, can this be done, and if so, how?

thanks in advance




CLR

Adding to a group of text.
 
Here's a macro solution...........

Sub ConcatenateMeJPG()
Dim lastrow As Long, r As Long
Dim num1 As String
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "A") < "" Then
Cells(r, "A").Select
num1 = Selection.Value
End If
With ActiveCell
.Value = num1 & ".jpg"
End With
Next r
End Sub

Vaya con Dios,
Chuck, CABGx3





"ChrisB" wrote:

I have about 5000 words in columns, I want to add a IMG extension on
these columns, cant his be achieved? for example:

1 WORD
2 PLAY
3 GAME


I would lke to add .JPG on the end of each of those words, all the way
down for 5,000 products, can this be done, and if so, how?

thanks in advance



ChrisB

Adding to a group of text.
 
all my data in those columns are different...if I were to ad
WORD&".JPG" , IT would only change "WORD" to "WORD.JPG" in that cell. I
need to be able to change all data in this column to GIF.


CLR

Adding to a group of text.
 
P.S..........
I don't know why you are wanting to do this, but as a point of interest, Jim
Cone's fine Add-in called ListFiles will go to a directory and retrieve all
the .jpg therein and put them in Excel and also create a link to
each..........it's VERY handy for me, maybe would be for you.........it's
available at

http://www.realezsites.com/bus/primitivesoftware/

Vaya con Dios,
Chuck, CABGx3



"CLR" wrote:

Here's a macro solution...........

Sub ConcatenateMeJPG()
Dim lastrow As Long, r As Long
Dim num1 As String
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "A") < "" Then
Cells(r, "A").Select
num1 = Selection.Value
End If
With ActiveCell
.Value = num1 & ".jpg"
End With
Next r
End Sub

Vaya con Dios,
Chuck, CABGx3





"ChrisB" wrote:

I have about 5000 words in columns, I want to add a IMG extension on
these columns, cant his be achieved? for example:

1 WORD
2 PLAY
3 GAME


I would lke to add .JPG on the end of each of those words, all the way
down for 5,000 products, can this be done, and if so, how?

thanks in advance



ChrisB

Adding to a group of text.
 
macro worked great!! thanks




CLR wrote:
Here's a macro solution...........

Sub ConcatenateMeJPG()
Dim lastrow As Long, r As Long
Dim num1 As String
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "A") < "" Then
Cells(r, "A").Select
num1 = Selection.Value
End If
With ActiveCell
.Value = num1 & ".jpg"
End With
Next r
End Sub

Vaya con Dios,
Chuck, CABGx3





"ChrisB" wrote:

I have about 5000 words in columns, I want to add a IMG extension on
these columns, cant his be achieved? for example:

1 WORD
2 PLAY
3 GAME


I would lke to add .JPG on the end of each of those words, all the way
down for 5,000 products, can this be done, and if so, how?

thanks in advance




CLR

Adding to a group of text.
 
This one will do all the words in column A as .jpg and all the words in
column B as .gif

Sub ConcatenateMeExtention()
Dim lastrow As Long, r As Long
Dim num1 As String
Dim num2 As String
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "A") < "" Then
Cells(r, "A").Select
num1 = Selection.Value
End If
With ActiveCell
.Value = num1 & ".jpg"
End With
Next r

lastrow = Cells(Rows.Count, "B").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "B") < "" Then
Cells(r, "B").Select
num1 = Selection.Value
End If
With ActiveCell
.Value = num1 & ".gif"
End With
Next r
End Sub

hth
Vaya con Dios,
Chuck, CABGx3



"ChrisB" wrote:

all my data in those columns are different...if I were to ad
WORD&".JPG" , IT would only change "WORD" to "WORD.JPG" in that cell. I
need to be able to change all data in this column to GIF.



CLR

Adding to a group of text.
 
Happy to help.........thanks for the feedback.

Vaya con Dios,
Chuck, CABGx3




"ChrisB" wrote:

macro worked great!! thanks




CLR wrote:
Here's a macro solution...........

Sub ConcatenateMeJPG()
Dim lastrow As Long, r As Long
Dim num1 As String
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For r = lastrow To 1 Step -1
If Cells(r, "A") < "" Then
Cells(r, "A").Select
num1 = Selection.Value
End If
With ActiveCell
.Value = num1 & ".jpg"
End With
Next r
End Sub

Vaya con Dios,
Chuck, CABGx3





"ChrisB" wrote:

I have about 5000 words in columns, I want to add a IMG extension on
these columns, cant his be achieved? for example:

1 WORD
2 PLAY
3 GAME


I would lke to add .JPG on the end of each of those words, all the way
down for 5,000 products, can this be done, and if so, how?

thanks in advance





David Biddulph

Adding to a group of text.
 
So copy it down the column. If you want GIF instead of JPG, change the
formula accordingly.
--
David Biddulph

"ChrisB" wrote in message
ups.com...
all my data in those columns are different...if I were to ad
WORD&".JPG" , IT would only change "WORD" to "WORD.JPG" in that cell. I
need to be able to change all data in this column to GIF.





All times are GMT +1. The time now is 03:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com