อยากทราบว่ามีวิธีเขียนที่ง่ายกว่านี้หรือเปล่าครับ
Posted: Thu May 14, 2020 1:14 am
Sub SchedulingTable2()
With Sheets("Mon")
.Range("J2").Cells.Value = T1.Range("I9") & " " & T1.Range("I10")
.Range("J3").Cells.Value = T2.Range("I9") & " " & T2.Range("I10")
.Range("J4").Cells.Value = T3.Range("I9") & " " & T3.Range("I10")
.Range("J5").Cells.Value = T4.Range("I9") & " " & T4.Range("I10")
.Range("J6").Cells.Value = T5.Range("I9") & " " & T5.Range("I10")
.Range("J7").Cells.Value = T6.Range("I9") & " " & T6.Range("I10")
.Range("J8").Cells.Value = T7.Range("I9") & " " & T7.Range("I10")
.Range("J9").Cells.Value = T8.Range("I9") & " " & T8.Range("I10")
.Range("J10").Cells.Value = T9.Range("I9") & " " & T9.Range("I10")
.Range("J11").Cells.Value = T10.Range("I9") & " " & T10.Range("I10")
.Range("J12").Cells.Value = T11.Range("I9") & " " & T11.Range("I10")
.Range("J13").Cells.Value = T12.Range("I9") & " " & T12.Range("I10")
.Range("J14").Cells.Value = T13.Range("I9") & " " & T13.Range("I10")
.Range("J15").Cells.Value = T14.Range("I9") & " " & T14.Range("I10")
.Range("J16").Cells.Value = T15.Range("I9") & " " & T15.Range("I10")
.Range("J17").Cells.Value = T16.Range("I9") & " " & T16.Range("I10")
.Range("J18").Cells.Value = T17.Range("I9") & " " & T17.Range("I10")
.Range("J19").Cells.Value = T18.Range("I9") & " " & T18.Range("I10")
.Range("J20").Cells.Value = T19.Range("I9") & " " & T19.Range("I10")
.Range("J21").Cells.Value = T20.Range("I9") & " " & T20.Range("I10")
.Range("J22").Cells.Value = T21.Range("I9") & " " & T21.Range("I10")
.Range("J23").Cells.Value = T22.Range("I9") & " " & T22.Range("I10")
.Range("J24").Cells.Value = T23.Range("I9") & " " & T23.Range("I10")
.Range("J25").Cells.Value = T24.Range("I9") & " " & T24.Range("I10")
.Range("J26").Cells.Value = T25.Range("I9") & " " & T25.Range("I10")
.Range("J27").Cells.Value = T26.Range("I9") & " " & T26.Range("I10")
.Range("J28").Cells.Value = T27.Range("I9") & " " & T27.Range("I10")
.Range("J29").Cells.Value = T28.Range("I9") & " " & T28.Range("I10")
End With
MsgBox "·Ó¡ÒÃàÃÕ¡¢éÍÁÙŵÒÃÒ§Ê͹àÃÕºÃéÍÂáÅéÇ", vbInformation, "àÊÃç¨ÊÔé¹"
End Sub
With Sheets("Mon")
.Range("J2").Cells.Value = T1.Range("I9") & " " & T1.Range("I10")
.Range("J3").Cells.Value = T2.Range("I9") & " " & T2.Range("I10")
.Range("J4").Cells.Value = T3.Range("I9") & " " & T3.Range("I10")
.Range("J5").Cells.Value = T4.Range("I9") & " " & T4.Range("I10")
.Range("J6").Cells.Value = T5.Range("I9") & " " & T5.Range("I10")
.Range("J7").Cells.Value = T6.Range("I9") & " " & T6.Range("I10")
.Range("J8").Cells.Value = T7.Range("I9") & " " & T7.Range("I10")
.Range("J9").Cells.Value = T8.Range("I9") & " " & T8.Range("I10")
.Range("J10").Cells.Value = T9.Range("I9") & " " & T9.Range("I10")
.Range("J11").Cells.Value = T10.Range("I9") & " " & T10.Range("I10")
.Range("J12").Cells.Value = T11.Range("I9") & " " & T11.Range("I10")
.Range("J13").Cells.Value = T12.Range("I9") & " " & T12.Range("I10")
.Range("J14").Cells.Value = T13.Range("I9") & " " & T13.Range("I10")
.Range("J15").Cells.Value = T14.Range("I9") & " " & T14.Range("I10")
.Range("J16").Cells.Value = T15.Range("I9") & " " & T15.Range("I10")
.Range("J17").Cells.Value = T16.Range("I9") & " " & T16.Range("I10")
.Range("J18").Cells.Value = T17.Range("I9") & " " & T17.Range("I10")
.Range("J19").Cells.Value = T18.Range("I9") & " " & T18.Range("I10")
.Range("J20").Cells.Value = T19.Range("I9") & " " & T19.Range("I10")
.Range("J21").Cells.Value = T20.Range("I9") & " " & T20.Range("I10")
.Range("J22").Cells.Value = T21.Range("I9") & " " & T21.Range("I10")
.Range("J23").Cells.Value = T22.Range("I9") & " " & T22.Range("I10")
.Range("J24").Cells.Value = T23.Range("I9") & " " & T23.Range("I10")
.Range("J25").Cells.Value = T24.Range("I9") & " " & T24.Range("I10")
.Range("J26").Cells.Value = T25.Range("I9") & " " & T25.Range("I10")
.Range("J27").Cells.Value = T26.Range("I9") & " " & T26.Range("I10")
.Range("J28").Cells.Value = T27.Range("I9") & " " & T27.Range("I10")
.Range("J29").Cells.Value = T28.Range("I9") & " " & T28.Range("I10")
End With
MsgBox "·Ó¡ÒÃàÃÕ¡¢éÍÁÙŵÒÃÒ§Ê͹àÃÕºÃéÍÂáÅéÇ", vbInformation, "àÊÃç¨ÊÔé¹"
End Sub