View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Adding suffix to column entries

Hi,

This assumes column A so change to suit.
Right click your sheet tab, view code and paste this in.
WARNING this will add .jpg to everything in that column and even convert
formula to values with .jpg on the end. If there are other data in the column
then post back with details.

Sub appendJPG()
Dim MyRange As Range
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set MyRange = Range("A1:A" & lastrow)
For Each c In MyRange
If c.Value < "" Then
c.Value = c.Value & ".jpg"
End If
Next
End Sub

Mike

"NCdesigner" wrote:

I have a column of 11,000 entries. These are stock numbers for a website
store. The image that goes with each item has the same number. I need to add
".jpg" to even entry in that column without doing it one-by-one. Can anyone
tell me how to do it?
--
NC designer