A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding suffix to column entries



 
 
Thread Tools Display Modes
  #1  
Old October 13th, 2008, 12:32 PM posted to microsoft.public.excel.worksheet.functions
NCdesigner
external usenet poster
 
Posts: 4
Default Adding suffix to column entries

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
  #2  
Old October 13th, 2008, 12:41 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
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

  #3  
Old October 13th, 2008, 01:17 PM posted to microsoft.public.excel.worksheet.functions
muddan madhu
external usenet poster
 
Posts: 695
Default Adding suffix to column entries

may be ?

=SUBSTITUTE(A2,A2,A2&".jpg") and drag it down





On Oct 13, 4:32*pm, 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


  #4  
Old October 13th, 2008, 01:39 PM posted to microsoft.public.excel.worksheet.functions
NCdesigner
external usenet poster
 
Posts: 4
Default Adding suffix to column entries

Thanks so much for your vuick response...I followed your instructions:
highlighted the column, right clicked the sheet tab, clicked the view tab,
and pasted in the code. The pull down menus at the top read (general) and
appendJPG. After doing this do I save "Book 1"?

I actually clicked FileClose and return to MicroSoft Excel but I didn't see
".jpg" added to the entries in the column. (I am using column A)
--
NC designer

"Mike H" wrote:

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

  #5  
Old October 13th, 2008, 02:59 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Adding suffix to column entries

Did you run the code?

Tools|Macro|Macros
select this workbook
Select the macro
Click Run

Mike


"NCdesigner" wrote:

Thanks so much for your vuick response...I followed your instructions:
highlighted the column, right clicked the sheet tab, clicked the view tab,
and pasted in the code. The pull down menus at the top read (general) and
appendJPG. After doing this do I save "Book 1"?

I actually clicked FileClose and return to MicroSoft Excel but I didn't see
".jpg" added to the entries in the column. (I am using column A)
--
NC designer

"Mike H" wrote:

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

  #6  
Old October 13th, 2008, 03:49 PM posted to microsoft.public.excel.worksheet.functions
NCdesigner
external usenet poster
 
Posts: 4
Default Adding suffix to column entries

Thanks Mike, You've save me a lot of frustration and time.
--
NC designer


"Mike H" wrote:

Did you run the code?

Tools|Macro|Macros
select this workbook
Select the macro
Click Run

Mike


"NCdesigner" wrote:

Thanks so much for your vuick response...I followed your instructions:
highlighted the column, right clicked the sheet tab, clicked the view tab,
and pasted in the code. The pull down menus at the top read (general) and
appendJPG. After doing this do I save "Book 1"?

I actually clicked FileClose and return to MicroSoft Excel but I didn't see
".jpg" added to the entries in the column. (I am using column A)
--
NC designer

"Mike H" wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.