- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¦^´_ 6# av8d
Private Sub CommandButton1_Click()
'¼È°±¥|Ó®e©ö©ìºCªº Excel ¥\¯à
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
'Application.EnableEvents = False
'On Error Resume Next
'§ó·s¬¡¶Ã¯¡G¥«¥Á¥d¤é³øªí
FN = "¥«¥Á¥d¤é³øªí" 'ÀɮצWºÙ
Set FNwb = Workbooks.Open(ThisWorkbook.Path & "\" & FN) '¶}±Ò¸ÓÀÉ®×
CB = Left(ComboBox1, Len(ComboBox1) - 3) '©Ò³]©wªº¤é´Á
'yTD = Format(CB, "yyyy") - 1911
mTD = Format(CB, "m")
dTD = Format(CB, "d")
FNTD = mTD & "¤ë"
Dim FNcell As Range
For Each Z In FNwb.Sheets(FNTD).Range("C2:CM2")
If Z.Value = Int(Format((DateValue(CB)), 0)) Then
Set FNcell = Z
Exit For
End If
Next
ActiveWindow.ScrollColumn = FNcell.Column - 15
ActiveWindow.ScrollRow = FNcell.Row - 1
If Not FNcell Is Nothing Then
FNcell.Offset(1, 0).Select
For m = 7 To 12
For n = 1 To 4
ActiveCell.Offset(m, n - 1) = Cells(m + 5, n * 2)
Next
Next
For m = 19 To 24
For n = 1 To 4
ActiveCell.Offset(m, n - 1) = Cells(m, n * 2)
Next
Next
ActiveCell.Offset(-1, 0).Select
'§ó·s[¾ú¥v¦Xp]
Dim i As Integer, j As Integer
'·í¤é¦Xp¶K¨ì¾ú¥v¦XpB4:B9
For i = 4 To 9
Cells(i, 2) = Cells(i + 8, 4)
Next
'·í¤é¦Xp¶K¨ì¾ú¥v¦XpD4:D9
For i = 4 To 9
Cells(i, 4) = Cells(i + 8, 8)
Next
'·í¤é¦Xp¶K¨ì¾ú¥v¦XpF4:F9
For i = 4 To 9
Cells(i, 6) = Cells(i + 15, 4)
Next
'·í¤é¦Xp¶K¨ì¾ú¥v¦XpH4:H9
For i = 4 To 9
Cells(i, 8) = Cells(i + 15, 8)
Next
'²M°£[·í¤é¦Xp]
For i = 2 To 8 Step 2
For j = 12 To 17
Cells(j, i) = ""
Next
Next
For i = 2 To 8 Step 2
For j = 19 To 24
Cells(j, i) = ""
Next
Next
[K3:O15].ClearContents
[J20].ClearContents
Else
MsgBox "¦b¡i¥«¥Á¥d¤é³øªí¡j¤¤§ä¤£¨ì " & CB & " ¡A°Ê§@²×¤î¡C"
End If
'«ì´_¥|Ó®e©ö©ìºCªº Excel ¥\¯à
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
'Application.EnableEvents = True
End Sub |
|