View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 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.