| ©«¤l5923 ¥DÃD13 ºëµØ1 ¿n¤À5986 ÂI¦W0  §@·~¨t²Îwin10 ³nÅ骩¥»Office 2010 ¾\ŪÅv150 ©Ê§O¨k ¨Ó¦Û¥xÆW°ò¶© µù¥U®É¶¡2010-5-1 ³Ì«áµn¿ý2022-1-23 
         
 | 
                
| ¦^´_ 1# fangsc ½Æ»s¥N½XSub Loaddata()
Dim fcsty, bklogy As Integer
Dim current_PL, current_cust_ID As String
Dim search_PL, search_cust_ID As String
Dim TC_Maxrow As Integer
Dim Backlog_maxrow As Integer
Dim start_col_in_TC As Integer
Dim PL_index_col, CID_index_col As Integer
'-----------------------------
Dim Ar(1 To 2), xi As Integer, MyColorIndex As Integer
'-----------------------------
PL_index_col = 1
CID_index_col = 3
TC_Maxrow = 16
Backlog_maxrow = 17
start_col_in_TC = 58
'----------------------------------------------
Ar(1) = Array(0, 1, 3, 4, 5, 50, 51, 52, 53, 54)
Ar(2) = Array(7, 8, 9, 10, 11, 14, 15, 16, 17, 18)
MyColorIndex = 7                       '©³¦â ¼ÆÈ
'----------------------------------------------
Worksheets("TC").Activate
For fcsty = 2 To TC_Maxrow
    search_PL = Worksheets("TC").Cells(fcsty, 16) '.FormulaR1C1
    search_cust_ID = Worksheets("TC").Cells(fcsty, 13) '.FormulaR1C1
    'Worksheets("1").Select
    For bklogy = 2 To Backlog_maxrow
        current_PL = Worksheets("1").Cells(bklogy, PL_index_col) '.FormulaR1C1
        current_cust_ID = Worksheets("1").Cells(bklogy, CID_index_col) '.FormulaR1C1
        If Val(search_PL) = Val(current_PL) And Val(search_cust_ID) = Val(current_cust_ID) Then
        ' ±ø¥ó²Å¦X®É,±Nworksheet "1"ªºcurrent_PL ¤Î current_cust_ID ¥[¤W©³¦â,¦A°õ¦æ¥H¤U¼g¤J¸ê®Æ
            Worksheets("1").Cells(bklogy, PL_index_col).Interior.ColorIndex = MyColorIndex
            Worksheets("1").Cells(bklogy, CID_index_col).Interior.ColorIndex = MyColorIndex
            For xi = 0 To UBound(Ar(1))
                Worksheets("TC").Cells(fcsty, start_col_in_TC + Ar(1)(xi)) = Val(Worksheets("1").Cells(bklogy, Ar(2)(xi)))
            Next
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 7).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 1).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 8).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 3).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 9).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 4).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 10).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 5).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 11).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 50).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 14).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 51).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 15).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 52).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 16).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 53).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 17).FormulaR1C1)
            ' Worksheets("TC").Cells(fcsty, start_col_in_TC + 54).FormulaR1C1 = Val(Worksheets("1").Cells(bklogy, 18).FormulaR1C1)
        End If
    Next 'bklogy
Next 'fcsty
End Sub
 | 
 |