Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

help me to change part Number automatically 1

Status
Not open for further replies.

nguyenthanhcong

Mechanical
Apr 10, 2018
2
VN
Hi everybody.
I have some parts with part number such as:

XXX-YYY-ZZZ-ab ( for example HIA-123-456-01)
with ab = 01->49

I want to change 2 last letters of part number as :

XXX-YYY-ZZZ-cd with cd = ab+50
forexample : HIA-123-456-01 -> HIA-123-456-51

Can you help me to write a macro?
thankyou very much





 
Replies continue below

Recommended for you

newpartnumber = left(oldpartnumber,len(oldpartnumber)-2) & cstr(cint(right(oldpartnumber,2))+50)

didn't test it, should be fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top