Excel 2002 : Quik way of getting customer name

G

Guest

Dear Sir,

I have a block of Credit Note reference and customer name separated by “-“
as illustrated

A
B

FAF CN NK000156 – SUMISO S/B (PJVM) SUMISO S/B (PJVM)
FAF CN NK000133 - PANASONIC PANASONIC
FAF CN NK000154 - ATAMA LOGISTIC ATAMA LOGISTIC
FAF CN NK000158 - DNE LOGISTICS S/B DNE LOGISTICS S/B
FAF CN NK000155 - KUMISU YUKU SDN BHD KUMISU YUKU SDN BHD

May I know If there is a quick way of getting the full customer name just
behind the “-†as an output in columm B ?



Thanks

Low
 
D

Don Guillett

Sub finddash()
For Each c In Range("a17:a21")
x = InStr(c, "-") + 1
MsgBox x
c.Offset(, 1) = Right(c, Len(c) - x)
Next
End Sub

Or if ALWAYS 17 use that instead
Sub finddash1()
For Each c In Range("a17:a21")
c.Offset(, 1) = Right(c, Len(c) - 18)
Next
End Sub
 

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

Similar Threads


Top