Solved

UPC-A codes check digit macro request

Posted on 2009-05-18
3
500 Views
Last Modified: 2012-05-07
I have a listing of 11-digit codes that I need to create into UPC-A codes to store in Excel, the barcode is not required. Can someone create a macro with install directions?

I have the UPC Code in one column and want to get the UPC-A (with check digit code) in the column next to it
UPC CODE	UPC-A Code

69681200001	

69681200002	

69681200003	

69681200004	

69681200005	

69681200006	

69681200007	

69681200008	

69681200009	

69681200010	

69681200011	

69681200012	

69681200013	

69681200014	

69681200015	

69681200016

69681200017

Open in new window

0
Comment
Question by:trayceejay
  • 2
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 24412861
You can use a formula. Assuming the UPC code is in A1:

   =9-MOD(SUMPRODUCT(VALUE(MID(A1,ROW(OFFSET($A$1,0,0,LEN(A1))),1))*(MOD(ROW(OFFSET($A$1,17-LEN(A1),0,LEN(A1))),2)*2+1))-1,10)

Kevin
0
 

Author Comment

by:trayceejay
ID: 24413001
Thanks for the quick response! I have a question on how to handle if it's not in A1.

If it's not in A1, do I simply change all A1 to be the cell it's in? Does this include $A$1 or no?

0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 24413033
No. Do not change the $A$1 references. That is used as a trick to make the SUMPRODUCT function work. The same formula assuming the value is in A2:

   =9-MOD(SUMPRODUCT(VALUE(MID(A2,ROW(OFFSET($A$1,0,0,LEN(A2))),1))*(MOD(ROW(OFFSET($A$1,17-LEN(A2),0,LEN(A2))),2)*2+1))-1,10)

Kevin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Meetings to discuss business process can waste time, and often do .  The meeting's dialog can get confusing when participants have different professional perspectives and backgrounds.  A jointly-developed process picture helps wade through the confu…
PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now