ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Modification of Part Number (Revised) (https://www.excelbanter.com/excel-discussion-misc-queries/15160-modification-part-number-revised.html)

Tiziano

Modification of Part Number (Revised)
 
I would like to add the string "1212" (no quotes) to some part numbers.

Essentially, I have two versions of part numbers to modify:
xxxxxxx(space)(space)xxxxxxxxxx(space)xxxxx(space) xxxx
or
xxxxxxxxxx(space)xxxxx(space)(space)xxxxxxx(space) xxxx(space)xxxx

The length of the xxxxxx strings varies and represents alphanumeric
characters that must remain unchanged. The string "1212" (no quotes) must
always be appended to the first xxxxx string of alphanumeric characters.

Thus the end result of the modification should be as follows:
xxxxxxx1212(space)(space)xxxxxxxxxx(space)xxxxx(sp ace)xxxx
or
xxxxxxxxxx1212(space)xxxxx(space)(space)xxxxxxx(sp ace)xxxx(space)xxxx

All the part numbers that I want to modify will be listed in Column A of my
spreadsheet. (There are other part numbers in other columns but I do not
want to modify them.)

Would somebody please suggest how to do it? This is beyond my knowledge of
Excel.

Thanks in advance.
----
Tiziano



Earl Kiosterud

Tiziano,

=LEFT(A2,FIND(" ",A2)-1)& "1212" &MID(A2,FIND(" ",A2),999)

Put this in another column, and copy down with the Fill Handle.
Paste-Special-Values over the original for a permanent change.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Tiziano" wrote in message
...
I would like to add the string "1212" (no quotes) to some part numbers.

Essentially, I have two versions of part numbers to modify:
xxxxxxx(space)(space)xxxxxxxxxx(space)xxxxx(space) xxxx
or
xxxxxxxxxx(space)xxxxx(space)(space)xxxxxxx(space) xxxx(space)xxxx

The length of the xxxxxx strings varies and represents alphanumeric
characters that must remain unchanged. The string "1212" (no quotes) must
always be appended to the first xxxxx string of alphanumeric characters.

Thus the end result of the modification should be as follows:
xxxxxxx1212(space)(space)xxxxxxxxxx(space)xxxxx(sp ace)xxxx
or
xxxxxxxxxx1212(space)xxxxx(space)(space)xxxxxxx(sp ace)xxxx(space)xxxx

All the part numbers that I want to modify will be listed in Column A of
my
spreadsheet. (There are other part numbers in other columns but I do not
want to modify them.)

Would somebody please suggest how to do it? This is beyond my knowledge
of
Excel.

Thanks in advance.
----
Tiziano





Don Guillett

I just re-tested this. Why doesn't it work for you?

Sub addnuminstr()
For Each c In Selection
X = InStr(c, " ") - 1
MsgBox Left(c, X) & 1212 & Right(c, Len(c) - X)
Next c
End Sub

--
Don Guillett
SalesAid Software

"Tiziano" wrote in message
...
I would like to add the string "1212" (no quotes) to some part numbers.

Essentially, I have two versions of part numbers to modify:
xxxxxxx(space)(space)xxxxxxxxxx(space)xxxxx(space) xxxx
or
xxxxxxxxxx(space)xxxxx(space)(space)xxxxxxx(space) xxxx(space)xxxx

The length of the xxxxxx strings varies and represents alphanumeric
characters that must remain unchanged. The string "1212" (no quotes) must
always be appended to the first xxxxx string of alphanumeric characters.

Thus the end result of the modification should be as follows:
xxxxxxx1212(space)(space)xxxxxxxxxx(space)xxxxx(sp ace)xxxx
or
xxxxxxxxxx1212(space)xxxxx(space)(space)xxxxxxx(sp ace)xxxx(space)xxxx

All the part numbers that I want to modify will be listed in Column A of

my
spreadsheet. (There are other part numbers in other columns but I do not
want to modify them.)

Would somebody please suggest how to do it? This is beyond my knowledge

of
Excel.

Thanks in advance.
----
Tiziano





Tiziano

You're right, Don, it works just right.
I guess I am not much used to running macros...
Thanks.
----
Tiziano

"Don Guillett" wrote in message
...
I just re-tested this. Why doesn't it work for you?

Sub addnuminstr()
For Each c In Selection
X = InStr(c, " ") - 1
MsgBox Left(c, X) & 1212 & Right(c, Len(c) - X)
Next c
End Sub

--
Don Guillett
SalesAid Software

"Tiziano" wrote in message
...
I would like to add the string "1212" (no quotes) to some part numbers.

Essentially, I have two versions of part numbers to modify:
xxxxxxx(space)(space)xxxxxxxxxx(space)xxxxx(space) xxxx
or
xxxxxxxxxx(space)xxxxx(space)(space)xxxxxxx(space) xxxx(space)xxxx

The length of the xxxxxx strings varies and represents alphanumeric
characters that must remain unchanged. The string "1212" (no quotes)

must
always be appended to the first xxxxx string of alphanumeric characters.

Thus the end result of the modification should be as follows:
xxxxxxx1212(space)(space)xxxxxxxxxx(space)xxxxx(sp ace)xxxx
or

xxxxxxxxxx1212(space)xxxxx(space)(space)xxxxxxx(sp ace)xxxx(space)xxxx

All the part numbers that I want to modify will be listed in Column A of

my
spreadsheet. (There are other part numbers in other columns but I do

not
want to modify them.)

Would somebody please suggest how to do it? This is beyond my knowledge

of
Excel.

Thanks in advance.
----
Tiziano







Tiziano

Thanks, Earl!
It works just fine.
----
Tiziano

"Earl Kiosterud" wrote in message
...
Tiziano,

=LEFT(A2,FIND(" ",A2)-1)& "1212" &MID(A2,FIND(" ",A2),999)

Put this in another column, and copy down with the Fill Handle.
Paste-Special-Values over the original for a permanent change.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

"Tiziano" wrote in message
...
I would like to add the string "1212" (no quotes) to some part numbers.

Essentially, I have two versions of part numbers to modify:
xxxxxxx(space)(space)xxxxxxxxxx(space)xxxxx(space) xxxx
or
xxxxxxxxxx(space)xxxxx(space)(space)xxxxxxx(space) xxxx(space)xxxx

The length of the xxxxxx strings varies and represents alphanumeric
characters that must remain unchanged. The string "1212" (no quotes)

must
always be appended to the first xxxxx string of alphanumeric characters.

Thus the end result of the modification should be as follows:
xxxxxxx1212(space)(space)xxxxxxxxxx(space)xxxxx(sp ace)xxxx
or
xxxxxxxxxx1212(space)xxxxx(space)(space)xxxxxxx(sp ace)xxxx(space)xxxx

All the part numbers that I want to modify will be listed in Column A of
my
spreadsheet. (There are other part numbers in other columns but I do

not
want to modify them.)

Would somebody please suggest how to do it? This is beyond my knowledge
of
Excel.

Thanks in advance.
----
Tiziano








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

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