提问加Q群341401932 加微信EXCEL880B领取免费教程
今天分享一个[Excel版实用VBA进销存系统(带应收应付,库存利润,客户账单)] ,这是一套比较完备的进销存系统,有客户管理,前台销售出单,入库单,库存计算,主要功能都在主页按钮
完整文件 在文章末尾下载
以上按钮均对应一个工作表,内部计算由vba及函数计算完成,一般用户可直接套用,本模板无任何密码保护,工作表及vba代码全部开放,有基础的同学可以自定修改定制,如需定制服务请联系EXCEL880B
代码用了27个窗体和6个模块,代码总计近万行,有兴趣学习的同学相信也可以学到很多东西
点击[使用说明]即可根据说明使用本表,主要功能界面展示如下
案例文件下载地址如下
Excel版综合进销存系统VBA代码开源,可任意修改
https://mp.weixin.qq.com/s/xEM9JXN-lQ9h_GTijSn8ew
部分代码如下
Sub SetListBox()
Dim wIdx As Long
Dim endrow As Long
Dim temp()
Dim i As Long, j As Long
Erase my
Erase arrRow
ListBox1.Clear
w = ""
With ListBox1
.ColumnCount = 6 '设置列数
For j = 1 To 6
w = w & Sheet1.Cells(1, j).Width & ";"
Next
w = Left(w, Len(w) - 1)
.ColumnWidths = w
.ColumnHeads = False '是否显示列标题
a = Sheet1.Range("A" & Rows.Count).End(xlUp).Row
If a < 2 Then a = 2
ReDim Preserve my(1 To 6, 1 To 1)
my(1, 1) = Sheet1.Range("A1") '
my(2, 1) = Sheet1.Range("B1") '
my(3, 1) = Sheet1.Range("C1") '
my(4, 1) = Sheet1.Range("D1") '
my(5, 1) = Sheet1.Range("E1") '
my(6, 1) = Sheet1.Range("F1") '
b = 1
For i = 2 To a
For j = 1 To 4
If Sheet1.Cells(i, j) Like "*" & TextBox1 & "*" Then
b = b + 1
ReDim Preserve my(1 To 6, 1 To b)
my(1, b) = Sheet1.Range("A" & i)
my(2, b) = Sheet1.Range("B" & i)
my(3, b) = Sheet1.Range("C" & i)
my(4, b) = Sheet1.Range("D" & i)
my(5, b) = Sheet1.Range("E" & i)
my(6, b) = Sheet1.Range("F" & i)
wIdx = wIdx + 1
ReDim Preserve arrRow(1 To wIdx)
arrRow(wIdx) = i
Exit For
End If
Next
Next
ReDim temp(1 To b, 1 To 6)
For i = 1 To b
For j = 1 To 6
temp(i, j) = my(j, i)
Next
Next
ListBox1.List() = temp
End With
End Sub