|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
名册.rar
(214.51 KB, 下载次数: 6)
各位老师,程序运行不了,以下代码出错。
Private Sub UserForm_Initialize()
a = Array("户号", "户主关系", "姓名", "身份证号", "电话", "家庭住址", "年龄", "性别", "民族", "文化程度", "社保情况", "医保情况", "政治面貌", "婚姻状况", "子女情况", "身体情况", "类别1", "类别2", "类别3", "类别4", "类别5", "备注")
For i = 0 To 21
Me.Controls(a(i)).Value = Sheets("人员名册").Cells(t, i + 1)
Next
End Sub
Private Sub 关闭_Click()
Unload Me
End Sub
Private Sub 录入_Click()
r = Sheets(1).Cells(Rows.Count, 2).End(3).row + 1
For i = 0 To 21
Sheets(1).Cells(r, i + 1) = Me.Controls(a(i)).Value
Next
Unload Me
End Sub
Private Sub 下一条_Click()
t = t + 1
For i = 0 To 21
Me.Controls(a(i)).Value = Sheets(1).Cells(t, i + 1)
Next
End Sub
Private Sub 修改_Click()
For i = 0 To 21
Sheets(1).Cells(t, i + 1) = Me.Controls(a(i)).Value
Next
Unload Me
End Sub
请各位老师帮忙。
|
|