View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
RayNDM83 RayNDM83 is offline
external usenet poster
 
Posts: 9
Default split prefix and suffix

Hi Don,
My bad, I didn't give more info about the prefixes and suffixes. The prefix
could be a number of different letters. It could be C, F, S, P, T or
combinations of FA or TA. The suffix could be an A, B or C. And the middle
letter could be a K, M or N. What I was thinking of doing is to find a way to
determine if there is one or two letter prefix and separate them from the
cell. After which I can just split the remaining characters by using the LEFT
formula where the numb_chars is 6.
Thanks,
Ray

"Don Guillett" wrote:


edit replace C ""
edit replace k k-
edit replace fa ""
edit replace a ""
or a looping macro
Sub fixstring()
For Each c In Selection
c.replace "K", "K-"
c.replace "FA", ""
c.replace "A", ""
Next
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"RayNDM83" wrote in message
...
C22K001
C15K015A
FA28K005A

Hi,
Could someone help me to split the cell and drop the prefixes C and FA as
well as the suffix A? What will be left will read 22K-001, 15K-015 or
28K-005.
Thanks for the help.
Ray