ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ®a¸Ì¨Ï¥Î®É¥i¥H¡A¨ì¤F¤½¥q´N¤£¦æ¡A

[µo°Ý] ®a¸Ì¨Ï¥Î®É¥i¥H¡A¨ì¤F¤½¥q´N¤£¦æ¡A

¥»©«³Ì«á¥Ñ av8d ©ó 2023-12-6 21:16 ½s¿è

µo¥d²Î­p.rar (54.49 KB) ¥«¥Á¥d¤é³øªí.rar (26.84 KB)

¨D±Ï¡A
®a¸Ì Excelª©¥» Office 2019 ¼Ð·Çª©
¤½¥q Excelª©¥» Office ®a¥Î¤Î¤¤¤p¥ø·~±M·~ª©2021

¨Ï¥Î¤èªk¡G¶}±Òµo¥d²Î­p¡A«öÀ£¤¤¶¡¤W¤èªº"§ó·s¦X­p"¡A
®a¸Ì¨Ï¥Î®É¥¿±`¡A·|¦b«ü©w¤é´Á¶ñ¤J­È¡A
¤½¥q¨Ï¥Î®É¿ù»~¡A·|§ä¤£¨ì«ü©w¤é´Á¡A§Ú¥»¨­¦³¼g§ä¤£¨ì¥X²{"¦b¡i¥«¥Á¥d¤é³øªí¡j¤¤§ä¤£¨ì"

¤£ª¾¹D¬O­þ¸Ì¥X°ÝÃD¡AÁÙ¬O»¡¨â­Óª©¥»³]©w¤W¦³°ÝÃD¡A¥Ø«e¤@ÀYÃú¤ô¡AÁٽЪ¾¹Dªº«e½úÀ°¦£¡AÁÂÁ¡I

¥»©«³Ì«á¥Ñ singo1232001 ©ó 2023-12-8 03:16 ½s¿è

¦^´_ 1# av8d


1.    °£¿ù ®É ¥ýµù±¼ on error resume next

2. Workbooks.Open (ThisWorkbook.Path & "\" & FN) '¶}±Ò¸ÓÀÉ®×  ·|¹ê»Ú¨Ì·Ó"windows¸ê®Æ§¨¶}±Ò°ÆÀɦW³]©w" §PÂ_¸ê®Æ  ¨Ò¦p.xlsx  §äÀÉ®×
¦pªG¨S¶} §Aªº¼gªk¬O¥¿½Tªº
­Y¶}°ÆÀɦW µ{§Ç´N§ä¤£¨ìÀÉ®×

3.©ÎªÌ¥ý¥Îdir¼g if§PÂ_ §ä¥ý§PÂ_Àɮצb¤£¦b ¤£¦A´N else ¥[¤W¦³°ÆÀɦWªº§ä
dirªº¤è¦¡°ÝGPT

TOP

¦^´_ 2# singo1232001


    Workbooks.Open (ThisWorkbook.Path & "\" & FN)  
ª½±µ§ï¦¨
Workbooks.Open  (ThisWorkbook.Path & "\" & FN & ".xlsx")
¸Õ¸Õ¬Ý

TOP

¦^´_ 3# singo1232001

·PÁ«e½ú¸Ñµª¡A¾Ç²ß¨ì¤F§óÄYÂÔªº¼¶¼g¤èªk¡A¨ü¥ÎµL½a¡C

TOP

¦bon error resume next
³oºØ¿ù¤F¤S¿ùªº±¡ªp«Ü®e©öµo¥Í

©Ò¥H³£·|³sÄò¨Ï¥Î
on error resume next
........
err.clear
on error goto 0

ªº¤è¦¡¨Ó±j¨î©¿²¤¿ù»~«á
ÁקK«á¤è¤S¥X¿ù¨S§ä¨ì°ÝÃD
¦b·íµ{§Çªº¶q¤j¨ì¤@©wµ{«× ³o¬O¥²¥Î¤Wªº§Þ³N

¥t¥~·í ¦³®É­Ôon error resume next «á
¹J¨ì¿ù»~ ´N¥²¶·Âk¹s ÁקKµ{§Ç¤S¿ù
¨Ò¦p
on error resume next
in isobect(ar) then err.clear:on error go to 0 :exit sub
err.clear:on error go to 0
...
...

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2023-12-12 22:05 ½s¿è

¦^´_ 5# singo1232001

ÁÂÁ«e½ú¡A¦A¦¸µo¥Í¤F¿ù»~(§Ú¦³¥[¤J.xlsm)¡A§ä¤F¦h¤é¡A¨S¦³µo²{¸Ñ¨M¤èªk¡AÁÂÁ«e½ú©âªÅÆ[¬Ý¡C

¨Ï¥Î¤èªk¡A±NÀH·N¼Æ­È¶ñ¤JK4:K15¡A«öJ2ªºµo¥d¡A¼Æ­È·|¦Û°Ê¥X²{¦b¥ªÃä¡A§Y¥i«ö¤W¤è¤¤¶¡ªº«ö¶s"§ó·s¦X­p"¡A
²Ä¤@¦¸¨Ï¥Î·|¥¿½T¶ñ¤J¡A¦sÀÉ«á¡AÃö³¬¡A²Ä¤G¦¸¨Ï¥Î¡A´N·|§ä¤£¨ì¤é´Á¡A

¹Á¸Õ¥´¶}¥«¥Á¥d¤é³øªí¨Ï¥ÎCtrl+F·j´M¡Aµo²{µLªk·j´M¤Q¦ì¼Æ¥H¤Wªº¤é´Á¡A¨Ò¡G12/11¡B12/23...µ¥

TOP

¦^´_ 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¦X­p]
        Dim i As Integer, j As Integer
        '·í¤é¦X­p¶K¨ì¾ú¥v¦X­pB4:B9
        For i = 4 To 9
            Cells(i, 2) = Cells(i + 8, 4)
        Next
        '·í¤é¦X­p¶K¨ì¾ú¥v¦X­pD4:D9
        For i = 4 To 9
            Cells(i, 4) = Cells(i + 8, 8)
        Next
        '·í¤é¦X­p¶K¨ì¾ú¥v¦X­pF4:F9
        For i = 4 To 9
            Cells(i, 6) = Cells(i + 15, 4)
        Next
        '·í¤é¦X­p¶K¨ì¾ú¥v¦X­pH4:H9
        For i = 4 To 9
            Cells(i, 8) = Cells(i + 15, 8)
        Next
        '²M°£[·í¤é¦X­p]
        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

TOP

¦^´_ 7# singo1232001

ÁÂÁ«e½ú¡A¨ü¯q¨}¦h¡A§Ú·|§V¤O¾Ç²ß«e½ú©Ò¼¶¼gªº­ì²z¡A¸Ñ¨M¤F§Ú¤@­Ó¤jÃøÃD¡C

TOP

¦^´_ 7# singo1232001

¸É¥R»¡©ú¡G

«e½ú±z¦n¡A§Úµo²{
Workbooks(FN).Sheets(FNTD).Activate
³o¬q­n¯dµÛ¡A´«¤ëªº®É­Ô¤~§ì¦a¨ì¡A¦A¦¸·PÁ«e½ú¸Ñ¨MÃøÃD¡C

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¤£¤@©w²y²y¬O¦n²y¡A¦ý¬O¦³¾ú½mªº±j¥´ªÌ¡AÀH®É³£¥i¥H´§´Î¡C
ªð¦^¦Cªí ¤W¤@¥DÃD