|
楼主 |
发表于 2016-3-8 22:29
|
显示全部楼层
Private Sub CommandButton1_Click()
Unload Me
If TextBox1.Value <> 8812968 Then
MsgBox "您输入的密码错,退出!", 64, " "
Unload Me
Else
Application.EnableEvents = False
Application.ScreenUpdating = False
Dim wb As Workbook, sh As Worksheet, rge As Range
Set wb = Workbooks.Open("D:\统计\录入日报.xls", Password:="jy000")
For s = 1 To 6
With ThisWorkbook.Worksheets(s)
.Unprotect Sheet6.[aa1]
wb.Worksheets(s).Unprotect Sheet6.[aa1]
wb.Sheets(s).Visible = -1
.Visible = -1
For Each rg In wb.Worksheets(s).Cells.SpecialCells(xlCellTypeConstants, 23)
.Range(rg.Address) = rg.Value
wb.Sheets(s).Protect Sheet6.[aa1]
.Protect Sheet6.[aa1]
Sheets("录入财收22").Select
Application.EnableEvents = True
Application.ScreenUpdating = True
MsgBox "执行完毕! ", 48, " 提示"
wb.Close False
Next
Next
End If
End With
End Sub
|
|