|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Private Sub TextBox1_Change()
Dim xb, mc_B, SJK, Wjm_2
On Error Resume Next
xb = Sheets("开单").Range("G6").Value
mc_B = Sheets("密码表").Range("C4").Text '普通用户密码
mc_cj = Sheets("辅助系统").Range("H4").Text '超级用户密码
If mc_B = TextBox1.Value Or mc_cj = TextBox1.Value Then
If xb = "1" Then
Application.ScreenUpdating = False '防止屏幕抖动,屏幕刷新禁止
ActiveWorkbook.Unprotect Password:="yxywg300866"
Shapes("Group 73").Visible = msoTrue
Shapes("Group 74").Visible = msoTrue
Shapes("Group 77").Visible = msoTrue
Shapes("Group 81").Visible = msoTrue
Shapes("Button 45").Visible = msoTrue
TextBox1.Visible = False
Label1.Visible = False
Label2.Visible = False
Shapes("Button 63").Visible = msoFalse
Shapes("Drop Down 19").Visible = False
Sheets("商品表").Visible = True
ActiveWorkbook.Protect Password:="yxywg300866", Structure:=True, Windows:=False
Workbooks.Open Filename:=ThisWorkbook.Path & "\" + Sheets("密码表").Range("B4").Value & "数据.xls"
SJK = Sheets("密码表").Range("B4").Value
Wjm_2 = Workbooks(SJK & "数据.xls").Name
Workbooks(Wjm_2).Sheets("员工").Range("A2:W3650").Copy Sheets("员工表拷贝").Range("a1")
Workbooks(Wjm_2).Sheets("库存").Range("F2:P3333").Copy Sheets("商品表拷贝").Range("a1")
Workbooks(Wjm_2).Sheets("数据辅助").Range("B1").Value = Sheets("辅助系统").Range("E5").Text + "数据.xls"
Workbooks(Wjm_2).Sheets("数据辅助").Range("D1").Value = Sheets("辅助系统").Range("G6").Value
Workbooks(Wjm_2).Sheets("数据辅助").Range("E1").Value = Sheets("辅助系统").Range("I3").Value
Application.ScreenUpdating = True '防止屏幕抖动,屏幕刷新禁止
Else
If xb = "A" Then
MsgBox "非专用客户,请与开发商联系" & Chr(50), 48, "提示"
Application.Quit
Windows(ThisWorkbook.Name).Close False
Else
MsgBox "服务期限已过,请与开发商联系", 48, "提示"
Application.Quit
Windows(ThisWorkbook.Name).Close False
End If
End If
End If
If mc_cj = TextBox1.Value Then
Sheets("辅助系统").Range("H7").Value = "Y"
Else
Sheets("辅助系统").Range("H7").Value = "N"
End If
End Sub
好久没用EXCEL写程序了。看了有点不习惯 |
|