这是在 Microsoft Excel 中生成条形码(generate a barcode in Microsoft Excel)的教程。您可能希望在Excel中生成条形码以制作产品目录或在Excel中跟踪库存商品或出于任何其他原因。本指南将向您展示在Excel电子表格中创建正常和随机条形码所需的步骤。
尽管没有本机选项,但您仍然可以轻松地在Excel工作簿中创建条形码。为此,您只需要使用自定义条码字体(use a custom barcode font)来生成特定类型的条码,例如Code 39、Code 128、通用产品代码(Universal Product Codes)( UPC )、国际商品编号(International Article Number)( EAN ) 等。这些字体是免费提供的在互联网上。您只需在Office中下载并安装所需的字体,然后在Excel中创建条形码。让我们来看看同样的一步一步的过程。
如何在 Excel 中创建条码
在这里,我们将生成Code 39类型的条形码。因此,我们将使用免费的Code 39 字体(Code 39 font)来生成条形码。但是,您可以根据类型选择任何其他条形码字体,并使用它在Excel工作簿中创建条形码。以下是在Excel(Excel)中创建条形码的基本步骤:
- 在Office(Office)中下载并安装Code 39字体。
- 启动Excel并创建一个新的空白电子表格。
- (Create two)使用文本(Text)和条形码(Barcode)名称创建两列。
- 格式化文本(Text)列中的单元格。
- 在条形码(Barcode)列中输入公式。
- 为条形码(Barcode)列中的单元格选择条形码字体。
- (Enter)在要为其生成条形码的文本列中(Text)输入字母数字数据。
让我们详细查看这些条形码创建步骤!
首先,您需要在Office中安装(Office)Code 39字体。您必须从 Internet 下载此字体。有各种免费字体下载器网站(free font downloader websites)可以从中获取此字体。
下载字体文件后,在 Office 中安装 Code 39 字体。我们从这里(here)使用了 Code 39 字体。只需(Simply)解压缩下载的字体文件夹,双击TTF字体文件,然后在打开的窗口中,单击安装(Install)按钮。
安装Code 39字体后,启动Excel应用程序并创建一个新的空白工作簿。现在,创建两个名称为Text和Barcode的列。
接下来,您必须格式化文本(Text)列中的单元格。为此,选择整个文本(Text)列并右键单击它。从上下文菜单中,选择“设置单元格格式(Format Cells)”选项。
之后,从“数字(Number)”选项卡中,单击“文本(Text)”类别,然后按“确定(OK)”按钮。这将基本上保留前导零,并且更大的数字不会以科学计数法显示。
现在,您需要在Barcode列="*"&A2&"*"
的第一个单元格中输入公式。我们假设 A2 是Text列的第一个单元格。如果是不同的列和单元格编号,例如 C2、D2 等,您可以相应地调整公式。如果Text Column(Text Column)中没有文本,它将显示两个星号。
您现在必须将上述公式复制到Barcode列中的所有单元格。只需(Just)选择第一个单元格,然后将光标从右下角拖到列的末尾。这会将输入的公式应用于条形码(Barcode)列中的所有单元格。
接下来,选择Barcode列中的所有单元格,然后转到Home > Font选项。从这里,选择已安装的Code 39字体,您将在相应的单元格中看到一个条形码。此外,在文本(Text)列中添加要为其生成条形码的文本。
选择条形码字体后,您将在条形码(Barcode)列中看到文本(Text)列中文本的条形码。
如何在Excel中生成(Excel)随机条码(Random Barcodes)
您还可以在Excel(Excel)中生成随机条码。这可以使用RANDBETWEEN函数来完成。使用此功能,您可以生成随机数、随机强密码(random strong passwords),甚至随机条码。除了上述步骤之外,您还可以按照以下步骤在 Excel 中创建随机条码:
为Barcode(Barcode)列选择条形码字体后(请参阅上面的一般条形码生成方法),转到Text列。选择整个列并右键单击它。单击(Click)Format Cell选项并转到Number选项(Number)卡并确保将其设置为General。
现在,选择文本(Text)列中的第一个单元格。在功能栏中,键入以下公式:=RANDBETWEEN(X,Y)
。X 是最小值,Y 是最大值。它基本上定义了生成数字的范围。例如,=RANDBETWEEN(5000,11000)
。这将生成一个介于 5000 到 11000 之间的随机数。
接下来,通过将光标从第一个单元格拖动到最后一个单元格,将此公式复制到文本列中的所有单元格。(Text)这样做会在整个文本(Text)列中生成随机数,您将能够在条形码(Barcode)列中查看相应的随机条形码。
就是这样!希望(Hope)这篇文章对您有所帮助!
现在阅读:(Now read:) 如何在 Microsoft Word 中创建条形码。(How to Create a Barcode in Microsoft Word.)
How to create Barcode in Excel
Here is а tutorіal to generate a barcode in Microsoft Excel. You might want to generate barcodes in Excel to make a product catalog or to track stocked items in Excel or for any other reason. This guide will show you the steps you need to use to create normal and random barcodes in your Excel spreadsheets.
Although there is no native option, you can still easily create a barcode in your Excel workbooks. To do so, you just need to use a custom barcode font to generate a particular type of barcode, such as Code 39, Code 128, Universal Product Codes (UPC), International Article Number (EAN), etc. These fonts are freely available on the internet. You can simply download and install the font you want in Office and then create barcodes in Excel. Let us check out a step-by-step procedure for the same.
How to create Barcode in Excel
Here, we will generate barcodes of Code 39 type. So, we will be using a free Code 39 font to generate the barcode. However, you can pick any other barcode font based on the type and use it to create a barcode in your Excel workbook. Here are the basic steps to create a barcode in Excel:
- Download and install Code 39 font in Office.
- Launch Excel and create a new blank spreadsheet.
- Create two columns with Text and Barcode names.
- Format the cells in the Text column.
- Enter a formula in the Barcode column.
- Select the barcode font for the cells in the Barcode column.
- Enter alphanumeric data in the Text column for which you want to generate a barcode.
Let us check out these barcode creation steps in detail!
Firstly, you need to install a Code 39 font in Office. You will have to download this font from the internet. There are various free font downloader websites to get this font from.
After downloading the font file, install the Code 39 font in Office. We have used a Code 39 font from here. Simply unzip the downloaded font folder, double click on the TTF font file, and then in the opened window, click on the Install button.
After installing the Code 39 font, launch the Excel application and create a new blank workbook. Now, create two columns with the names Text and Barcode.
Next, you have to format the cells in the Text column. For that, select the entire Text column and right-click on it. From the context menu, select the Format Cells option.
After that, from the Number tab, click on the Text category and press the OK button. This will basically preserve leading zeroes and also, larger numbers won’t be displayed in scientific notation.
Now, you need to enter the ="*"&A2&"*"
formula in the first cell of the Barcode column. We suppose A2 is the first cell of the Text column. If it’s a different column and cell number, e.g., C2, D2, etc., you can adjust the formula accordingly. In case there is no text in the Text Column, it will display two asterisks.
You now have to copy the above formula to all the cells in the Barcode column. Just select the first cell and then drag the cursor from the bottom-right corner toward the end of the column. This will apply the entered formula to all the cells in the Barcode column.
Next, select all the cells in the Barcode column and go to the Home > Font option. From here, choose the installed Code 39 font and you will see a barcode in the respective cells. Also, add the text for which you want to generate a barcode in the Text column.
As soon as you select the barcode font, you will see a barcode in the Barcode column for the text in the Text column.
How to Generate Random Barcodes in Excel
You can also generate a random barcode in Excel. This can be done using the RANDBETWEEN function. Using this function, you can generate random numbers, random strong passwords, and even random barcodes. In addition to the above-discussed steps, you can follow the below steps to create random barcodes in Excel:
After that selecting the barcode font for the Barcode column (refer to general barcode generation method above), go to the Text column. Select the entire column and right-click on it. Click on the Format Cell option and go to the Number tab and make sure it is set to General.
Now, select the first cell in the Text column. In the function bar, type the following formula: =RANDBETWEEN(X,Y)
. The X is the lowest value and Y is the highest value. It basically defines the range to generate a number. For example, =RANDBETWEEN(5000,11000)
. This will generate a random number between 5000 to 11000.
Next, copy this formula to all cells in the Text column by dragging the cursor from the first cell to the last cell. Doing so will generate random numbers in the entire Text column and you will be able to view respective random barcodes in the Barcode column.
That’s about it! Hope you find this article helpful!
Now read: How to Create a Barcode in Microsoft Word.