多语言展示
当前在线:1540今日阅读:161今日分享:11

使用 Excel 制作小超市收银系统

小超市大都有电脑了。上上网、看看片,即使不为小超市业务也会搞一台电脑。那么有没有办法利用电脑提高收银效率呢?答案是肯定的。现在就一步一步跟我一起创建自己的小超市收银机。实现的功能:1、输入商品条码号,自动显示商品的名称、价格和图片,并且自动加入到收银条中;2、使用照相机或者扫描枪扫描条码,自动显示商品的名称、价格和图片,并且加入到收银统计中;3、自动计算合计金额;一下子你的小超市就可以鸟枪换炮了!
工具/原料
1

Windows 电脑

2

Microsoft Excel

3

条码枪(可选)

4

打印机(可选)

基本步骤
1

打开 Excel 将商品信息输入到 Excel 中的 Sheet2 中

2

在 Excel 的 Sheet1 中最上面放一个输入框,用于输入条码或者扫描条码

3

在 Excel 的 Sheet1 中最上面放一个用于清零的按钮

4

双击这个“清零”按钮,打开VBA编辑窗口将其中自动生成的如下2行Private Sub CommandButton1_Click()End Sub换成输入如下的内容:Private Sub CommandButton1_Click()    For i = 4 To 100        If Me.Cells(i, 1) Is Nothing Then            Me.Cells(i, 2).Value = ''            Me.Cells(i, 3).Value = ''            Me.Cells(4, 2).Value = '合计'            Me.Cells(4, 3).Value = 0#            Exit For        End If        If Me.Cells(i, 1).Value = '' Then            Me.Cells(i, 2).Value = ''            Me.Cells(i, 3).Value = ''            Me.Cells(4, 2).Value = '合计'            Me.Cells(4, 3).Value = 0            Exit For        End If        Me.Cells(i, 1).Value = ''        Me.Cells(i, 2).Value = ''        Me.Cells(i, 3).Value = ''    Next     TextBox1.Text = ''     Image1.Picture = NothingEnd SubPrivate Sub TextBox1_Change()    If TextBox1.Text = '' Then        Exit Sub    End If    For i = 1 To 100        If Sheet2.Cells(i, 1).Value = TextBox1.Text Then            AddProd i            TextBox1.Text = ''            Exit For        End If        'MsgBox (Sheet2.Cells(i, 1).Value)        If Sheet2.Cells(i, 1) Is Nothing Then           Exit For        End If    NextEnd SubPrivate Sub AddProd(ByVal index As Integer)    For i = 4 To 100        If Me.Cells(i, 1) Is Nothing Then           Me.Cells(i, 1).Value = TextBox1.Text           Me.Cells(i, 2).Value = Sheet2.Cells(index, 2).Value           Me.Cells(i, 3).Value = Sheet2.Cells(index, 3).Value           Me.Cells(i + 1, 2).Value = '合计'           Me.Cells(i + 1, 3).Value = '=sum(C4:C' & i & ')'           Image1.Picture = LoadPicture(Sheet2.Cells(index, 4).Value)           Exit For        End If        If Me.Cells(i, 1).Value = '' Then            Me.Cells(i, 1).Value = TextBox1.Text           Me.Cells(i, 2).Value = Sheet2.Cells(index, 2).Value           Me.Cells(i, 3).Value = Sheet2.Cells(index, 3).Value           Me.Cells(i + 1, 2).Value = '合计'           Me.Cells(i + 1, 3).Value = '=sum(C4:C' & i & ')'           Image1.Picture = LoadPicture(Sheet2.Cells(index, 4).Value)           Exit For        End If    NextEnd Sub

5

返回 Excel选择“文件”菜单中的“关闭并返回到 Microsoft Excel(C)   Atl+Q”或者按 Atl+Q 组合键返回 Excel。

6

从设计模式退出开始收银点击“控件工具箱”中的设计模式图标(红色箭头所指),从设计模式退出,进入正常收银模式。可以开始收银乐。搞定!

注意事项

商品的图片最好输入图片的全路径,保存到一个固定的文件夹中

推荐信息