Prefix in every cell

M

Mike Busch

I would like to place a prefix for suffix in every cell, either or. I need to
place a part number that starts with the same tow letters, say PL, and then I
would like to only type in the part number but have the prefix in the same
cell, exp. type in 097886 and have PL097886 appear in the cell. Is this
do-able. Thanks in advance.
 
D

Don Guillett

Right click sheet tab>view code>insert this>change range to suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("f2:f22")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = "PL" & Target
Application.EnableEvents = True
End Sub
 
M

Mike H

Hi,

Select the cell(s) and then
Format|Cells
Select the Number Tab
Select Custom
Enter a cusytom format of PL#000000

Mike
 
D

Dave Peterson

You could give the cell a custom format:
"PL"000000
(it'll always show at least 6 digits)
 
J

Jim L

Mike everyone has their own preferences, I don't like to format the data to
show "PL"+ plus the number, but to actually create a new column with the
PL012345 part number. I would enter you part numbers in column A and then in
column B enter the formula ="PL"&A1 so column B shows the alpha numeric
part number.

Also since you are entering parts with leading zeros, be sure to format
column A to Text before starting so Excel doesn't 'help' you and remove the
leading zero.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top