No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

排班資料.vb 176KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963
  1. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  2. Imports Microsoft.Office.Interop.Excel.Constants
  3. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  4. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  5. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  6. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  7. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  8. Imports Microsoft.Office.Interop.Excel.XlWindowState
  9. Imports Microsoft.Office.Interop.Excel.XlPageOrientation
  10. Imports Microsoft.Office.Interop.Excel
  11. Public Class 排班資料
  12. Dim 星期 As String : Dim 天數, 總時數, 列高, 列高1, 欄寬1, 欄寬2 As Integer
  13. Dim 首次開啟 As Boolean : Dim 位置, 位置1, 位置2, 位置3, 位置4, 位置5, 位置6 As Integer
  14. Dim xlApp As Application : Dim xlBook As Workbook : Dim xlSheet As Worksheet
  15. Private Sub 年份_下拉表單資料載入()
  16. SQL_考勤明細表_年份_下拉()
  17. 年份_cb.Items.Clear()
  18. While (dr.Read()) : 年份_cb.Items.Add(dr("年份")) : End While
  19. conn.Close()
  20. End Sub
  21. Private Sub 讀取排班()
  22. Dim ds43 As New DataSet : 人員彙總_dgv.DataSource = Nothing : ds43.Clear()
  23. 人員彙總_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  24. 人員彙總_dgv.ColumnHeadersHeight = 45 : 人員彙總_dgv.AllowUserToAddRows = False : 人員彙總_dgv.RowTemplate.Height = 30
  25. SQL_排班系統_人員排班()
  26. da.Fill(ds43) : 人員彙總_dgv.DataSource = ds43.Tables(0) : conn.Close()
  27. 人員彙總_dgv.Columns(0).ReadOnly = True : 人員彙總_dgv.Columns(1).ReadOnly = True : 人員彙總_dgv.Columns(2).ReadOnly = True
  28. 人員彙總_dgv.Columns(3).ReadOnly = True : 人員彙總_dgv.Columns(4).ReadOnly = True : 人員彙總_dgv.Columns(5).ReadOnly = True
  29. 人員彙總_dgv.Columns(1).FillWeight = 80 : 人員彙總_dgv.Columns(5).FillWeight = 80 : 人員彙總_dgv.Columns("後段").Visible = False
  30. 人員彙總_dgv.Columns(1).DefaultCellStyle.Format = "#,##0" : 人員彙總_dgv.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
  31. 人員彙總_dgv.Columns(2).DefaultCellStyle.Format = "#,##0" : 人員彙總_dgv.Columns(2).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
  32. 人員彙總_dgv.Columns(3).DefaultCellStyle.Format = "#,##0.0" : 人員彙總_dgv.Columns(3).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  33. 人員彙總_dgv.Columns(4).DefaultCellStyle.Format = "#,##0.0" : 人員彙總_dgv.Columns(4).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  34. 人員彙總_dgv.Columns(5).DefaultCellStyle.Format = "#,##0" : 人員彙總_dgv.Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
  35. For i As Integer = 0 To 人員彙總_dgv.Rows.Count - 1
  36. Dim SS As Double = CInt(人員彙總_dgv.Rows(i).Cells("天數").Value.ToString) * 4
  37. 人員彙總_dgv.Rows(i).Cells("後段").Value = SS - CDbl(人員彙總_dgv.Rows(i).Cells("後段").Value.ToString)
  38. 人員彙總_dgv.Rows(i).Cells("已排班時數").Value = 人員彙總_dgv.Rows(i).Cells("已排班時數").Value - 人員彙總_dgv.Rows(i).Cells("後段").Value
  39. 人員彙總_dgv.Rows(i).Cells("未排班時數").Value = 人員彙總_dgv.Rows(i).Cells("未排班時數").Value + 人員彙總_dgv.Rows(i).Cells("後段").Value
  40. Next
  41. End Sub
  42. Private Sub 讀取日期()
  43. Dim ds As New DataSet : 日期_dgv.DataSource = Nothing : ds.Clear()
  44. 日期_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  45. 日期_dgv.ColumnHeadersHeight = 25 : 日期_dgv.AllowUserToAddRows = False
  46. SQL_排班系統_月份()
  47. da.Fill(ds) : 日期_dgv.DataSource = ds.Tables(0) : conn.Close()
  48. End Sub
  49. Private Sub 讀取班別1()
  50. Dim ds1 As New DataSet : DataGridView1.DataSource = Nothing : ds1.Clear()
  51. DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  52. DataGridView1.ColumnHeadersHeight = 列高1 : DataGridView1.AllowUserToAddRows = False : DataGridView1.RowTemplate.Height = 列高
  53. SQL_排班系統_當天排班()
  54. da.Fill(ds1) : DataGridView1.DataSource = ds1.Tables(0) : conn.Close()
  55. DataGridView1.Columns(0).FillWeight = 欄寬1 : DataGridView1.Columns(1).FillWeight = 欄寬2
  56. End Sub
  57. Private Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
  58. If 醫生_ch.Checked = True Then
  59. Dim linePen As New Pen(Color.Red, 2)
  60. If e.RowIndex = DataGridView1.Rows.Count - 1 Then : Exit Sub : Else
  61. If Strings.Mid(DataGridView1(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView1(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  62. Dim startX As Integer = IIf(DataGridView1.RowHeadersVisible, DataGridView1.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  63. Dim endX As Integer = startX + DataGridView1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView1.HorizontalScrollingOffset
  64. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  65. End If
  66. End If
  67. End If
  68. End Sub
  69. Private Sub 讀取班別2()
  70. Dim ds2 As New DataSet : DataGridView2.DataSource = Nothing : ds2.Clear()
  71. DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  72. DataGridView2.ColumnHeadersHeight = 列高1 : DataGridView2.AllowUserToAddRows = False : DataGridView2.RowTemplate.Height = 列高
  73. SQL_排班系統_當天排班()
  74. da.Fill(ds2) : DataGridView2.DataSource = ds2.Tables(0) : conn.Close()
  75. DataGridView2.Columns(0).FillWeight = 欄寬1 : DataGridView2.Columns(1).FillWeight = 欄寬2
  76. End Sub
  77. Private Sub DataGridView2_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView2.RowPostPaint
  78. If 醫生_ch.Checked = True Then
  79. Dim linePen As New Pen(Color.Red, 2)
  80. If e.RowIndex = DataGridView2.Rows.Count - 1 Then : Exit Sub : Else
  81. If Strings.Mid(DataGridView2(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView2(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  82. Dim startX As Integer = IIf(DataGridView2.RowHeadersVisible, DataGridView2.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  83. Dim endX As Integer = startX + DataGridView2.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView2.HorizontalScrollingOffset
  84. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  85. End If
  86. End If
  87. End If
  88. End Sub
  89. Private Sub 讀取班別3()
  90. Dim ds3 As New DataSet : DataGridView3.DataSource = Nothing : ds3.Clear()
  91. DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  92. DataGridView3.ColumnHeadersHeight = 列高1 : DataGridView3.AllowUserToAddRows = False : DataGridView3.RowTemplate.Height = 列高
  93. SQL_排班系統_當天排班()
  94. da.Fill(ds3) : DataGridView3.DataSource = ds3.Tables(0) : conn.Close()
  95. DataGridView3.Columns(0).FillWeight = 欄寬1 : DataGridView3.Columns(1).FillWeight = 欄寬2
  96. End Sub
  97. Private Sub DataGridView3_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView3.RowPostPaint
  98. If 醫生_ch.Checked = True Then
  99. Dim linePen As New Pen(Color.Red, 2)
  100. If e.RowIndex = DataGridView3.Rows.Count - 1 Then : Exit Sub : Else
  101. PA = Strings.Mid(DataGridView3(0, e.RowIndex).Value.ToString, 4, 1)
  102. If Strings.Mid(DataGridView3(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView3(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  103. Dim startX As Integer = IIf(DataGridView3.RowHeadersVisible, DataGridView3.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  104. Dim endX As Integer = startX + DataGridView3.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView3.HorizontalScrollingOffset
  105. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  106. End If
  107. End If
  108. End If
  109. End Sub
  110. Private Sub 讀取班別4()
  111. Dim ds4 As New DataSet : DataGridView4.DataSource = Nothing : ds4.Clear()
  112. DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  113. DataGridView4.ColumnHeadersHeight = 列高1 : DataGridView4.AllowUserToAddRows = False : DataGridView4.RowTemplate.Height = 列高
  114. SQL_排班系統_當天排班()
  115. da.Fill(ds4) : DataGridView4.DataSource = ds4.Tables(0) : conn.Close()
  116. DataGridView4.Columns(0).FillWeight = 欄寬1 : DataGridView4.Columns(1).FillWeight = 欄寬2
  117. End Sub
  118. Private Sub DataGridView4_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView4.RowPostPaint
  119. If 醫生_ch.Checked = True Then
  120. Dim linePen As New Pen(Color.Red, 2)
  121. If e.RowIndex = DataGridView4.Rows.Count - 1 Then : Exit Sub : Else
  122. If Strings.Mid(DataGridView4(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView4(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  123. Dim startX As Integer = IIf(DataGridView4.RowHeadersVisible, DataGridView4.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  124. Dim endX As Integer = startX + DataGridView4.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView4.HorizontalScrollingOffset
  125. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  126. End If
  127. End If
  128. End If
  129. End Sub
  130. Private Sub 讀取班別5()
  131. Dim ds5 As New DataSet : DataGridView5.DataSource = Nothing : ds5.Clear()
  132. DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  133. DataGridView5.ColumnHeadersHeight = 列高1 : DataGridView5.AllowUserToAddRows = False : DataGridView5.RowTemplate.Height = 列高
  134. SQL_排班系統_當天排班()
  135. da.Fill(ds5) : DataGridView5.DataSource = ds5.Tables(0) : conn.Close()
  136. DataGridView5.Columns(0).FillWeight = 欄寬1 : DataGridView5.Columns(1).FillWeight = 欄寬2
  137. End Sub
  138. Private Sub DataGridView5_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView5.RowPostPaint
  139. If 醫生_ch.Checked = True Then
  140. Dim linePen As New Pen(Color.Red, 2)
  141. If e.RowIndex = DataGridView5.Rows.Count - 1 Then : Exit Sub : Else
  142. If Strings.Mid(DataGridView5(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView5(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  143. Dim startX As Integer = IIf(DataGridView5.RowHeadersVisible, DataGridView5.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  144. Dim endX As Integer = startX + DataGridView5.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView5.HorizontalScrollingOffset
  145. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  146. End If
  147. End If
  148. End If
  149. End Sub
  150. Private Sub 讀取班別6()
  151. Dim ds6 As New DataSet : DataGridView6.DataSource = Nothing : ds6.Clear()
  152. DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  153. DataGridView6.ColumnHeadersHeight = 列高1 : DataGridView6.AllowUserToAddRows = False : DataGridView6.RowTemplate.Height = 列高
  154. SQL_排班系統_當天排班()
  155. da.Fill(ds6) : DataGridView6.DataSource = ds6.Tables(0) : conn.Close()
  156. DataGridView6.Columns(0).FillWeight = 欄寬1 : DataGridView6.Columns(1).FillWeight = 欄寬2
  157. End Sub
  158. Private Sub DataGridView6_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView6.RowPostPaint
  159. If 醫生_ch.Checked = True Then
  160. Dim linePen As New Pen(Color.Red, 2)
  161. If e.RowIndex = DataGridView6.Rows.Count - 1 Then : Exit Sub : Else
  162. If Strings.Mid(DataGridView6(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView6(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  163. Dim startX As Integer = IIf(DataGridView6.RowHeadersVisible, DataGridView6.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  164. Dim endX As Integer = startX + DataGridView6.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView6.HorizontalScrollingOffset
  165. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  166. End If
  167. End If
  168. End If
  169. End Sub
  170. Private Sub 讀取班別7()
  171. Dim ds7 As New DataSet : DataGridView7.DataSource = Nothing : ds7.Clear()
  172. DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  173. DataGridView7.ColumnHeadersHeight = 列高1 : DataGridView7.AllowUserToAddRows = False : DataGridView7.RowTemplate.Height = 列高
  174. SQL_排班系統_當天排班()
  175. da.Fill(ds7) : DataGridView7.DataSource = ds7.Tables(0) : conn.Close()
  176. DataGridView7.Columns(0).FillWeight = 欄寬1 : DataGridView7.Columns(1).FillWeight = 欄寬2
  177. End Sub
  178. Private Sub DataGridView7_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView7.RowPostPaint
  179. If 醫生_ch.Checked = True Then
  180. Dim linePen As New Pen(Color.Red, 2)
  181. If e.RowIndex = DataGridView7.Rows.Count - 1 Then : Exit Sub : Else
  182. If Strings.Mid(DataGridView7(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView7(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  183. Dim startX As Integer = IIf(DataGridView7.RowHeadersVisible, DataGridView7.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  184. Dim endX As Integer = startX + DataGridView7.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView7.HorizontalScrollingOffset
  185. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  186. End If
  187. End If
  188. End If
  189. End Sub
  190. Private Sub 讀取班別8()
  191. Dim ds8 As New DataSet : DataGridView8.DataSource = Nothing : ds8.Clear()
  192. DataGridView8.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  193. DataGridView8.ColumnHeadersHeight = 列高1 : DataGridView8.AllowUserToAddRows = False : DataGridView8.RowTemplate.Height = 列高
  194. SQL_排班系統_當天排班()
  195. da.Fill(ds8) : DataGridView8.DataSource = ds8.Tables(0) : conn.Close()
  196. DataGridView8.Columns(0).FillWeight = 欄寬1 : DataGridView8.Columns(1).FillWeight = 欄寬2
  197. End Sub
  198. Private Sub DataGridView8_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView8.RowPostPaint
  199. If 醫生_ch.Checked = True Then
  200. Dim linePen As New Pen(Color.Red, 2)
  201. If e.RowIndex = DataGridView8.Rows.Count - 1 Then : Exit Sub : Else
  202. If Strings.Mid(DataGridView8(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView8(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  203. Dim startX As Integer = IIf(DataGridView8.RowHeadersVisible, DataGridView8.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  204. Dim endX As Integer = startX + DataGridView8.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView8.HorizontalScrollingOffset
  205. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  206. End If
  207. End If
  208. End If
  209. End Sub
  210. Private Sub 讀取班別9()
  211. Dim ds9 As New DataSet : DataGridView9.DataSource = Nothing : ds9.Clear()
  212. DataGridView9.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  213. DataGridView9.ColumnHeadersHeight = 列高1 : DataGridView9.AllowUserToAddRows = False : DataGridView9.RowTemplate.Height = 列高
  214. SQL_排班系統_當天排班()
  215. da.Fill(ds9) : DataGridView9.DataSource = ds9.Tables(0) : conn.Close()
  216. DataGridView9.Columns(0).FillWeight = 欄寬1 : DataGridView9.Columns(1).FillWeight = 欄寬2
  217. End Sub
  218. Private Sub DataGridView9_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView9.RowPostPaint
  219. If 醫生_ch.Checked = True Then
  220. Dim linePen As New Pen(Color.Red, 2)
  221. If e.RowIndex = DataGridView9.Rows.Count - 1 Then : Exit Sub : Else
  222. If Strings.Mid(DataGridView9(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView9(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  223. Dim startX As Integer = IIf(DataGridView9.RowHeadersVisible, DataGridView9.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  224. Dim endX As Integer = startX + DataGridView9.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView9.HorizontalScrollingOffset
  225. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  226. End If
  227. End If
  228. End If
  229. End Sub
  230. Private Sub 讀取班別10()
  231. Dim ds10 As New DataSet : DataGridView10.DataSource = Nothing : ds10.Clear()
  232. DataGridView10.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  233. DataGridView10.ColumnHeadersHeight = 列高1 : DataGridView10.AllowUserToAddRows = False : DataGridView10.RowTemplate.Height = 列高
  234. SQL_排班系統_當天排班()
  235. da.Fill(ds10) : DataGridView10.DataSource = ds10.Tables(0) : conn.Close()
  236. DataGridView10.Columns(0).FillWeight = 欄寬1 : DataGridView10.Columns(1).FillWeight = 欄寬2
  237. End Sub
  238. Private Sub DataGridView10_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView10.RowPostPaint
  239. If 醫生_ch.Checked = True Then
  240. Dim linePen As New Pen(Color.Red, 2)
  241. If e.RowIndex = DataGridView10.Rows.Count - 1 Then : Exit Sub : Else
  242. If Strings.Mid(DataGridView10(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView10(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  243. Dim startX As Integer = IIf(DataGridView10.RowHeadersVisible, DataGridView10.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  244. Dim endX As Integer = startX + DataGridView10.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView10.HorizontalScrollingOffset
  245. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  246. End If
  247. End If
  248. End If
  249. End Sub
  250. Private Sub 讀取班別11()
  251. Dim ds11 As New DataSet : DataGridView11.DataSource = Nothing : ds11.Clear()
  252. DataGridView11.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  253. DataGridView11.ColumnHeadersHeight = 列高1 : DataGridView11.AllowUserToAddRows = False : DataGridView11.RowTemplate.Height = 列高
  254. SQL_排班系統_當天排班()
  255. da.Fill(ds11) : DataGridView11.DataSource = ds11.Tables(0) : conn.Close()
  256. DataGridView11.Columns(0).FillWeight = 欄寬1 : DataGridView11.Columns(1).FillWeight = 欄寬2
  257. End Sub
  258. Private Sub DataGridView11_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView11.RowPostPaint
  259. If 醫生_ch.Checked = True Then
  260. Dim linePen As New Pen(Color.Red, 2)
  261. If e.RowIndex = DataGridView11.Rows.Count - 1 Then : Exit Sub : Else
  262. If Strings.Mid(DataGridView11(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView11(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  263. Dim startX As Integer = IIf(DataGridView11.RowHeadersVisible, DataGridView11.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  264. Dim endX As Integer = startX + DataGridView11.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView11.HorizontalScrollingOffset
  265. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  266. End If
  267. End If
  268. End If
  269. End Sub
  270. Private Sub 讀取班別12()
  271. Dim ds12 As New DataSet : DataGridView12.DataSource = Nothing : ds12.Clear()
  272. DataGridView12.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  273. DataGridView12.ColumnHeadersHeight = 列高1 : DataGridView12.AllowUserToAddRows = False : DataGridView12.RowTemplate.Height = 列高
  274. SQL_排班系統_當天排班()
  275. da.Fill(ds12) : DataGridView12.DataSource = ds12.Tables(0) : conn.Close()
  276. DataGridView12.Columns(0).FillWeight = 欄寬1 : DataGridView12.Columns(1).FillWeight = 欄寬2
  277. End Sub
  278. Private Sub DataGridView12_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView12.RowPostPaint
  279. If 醫生_ch.Checked = True Then
  280. Dim linePen As New Pen(Color.Red, 2)
  281. If e.RowIndex = DataGridView12.Rows.Count - 1 Then : Exit Sub : Else
  282. If Strings.Mid(DataGridView12(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView12(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  283. Dim startX As Integer = IIf(DataGridView12.RowHeadersVisible, DataGridView12.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  284. Dim endX As Integer = startX + DataGridView12.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView12.HorizontalScrollingOffset
  285. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  286. End If
  287. End If
  288. End If
  289. End Sub
  290. Private Sub 讀取班別13()
  291. Dim ds13 As New DataSet : DataGridView13.DataSource = Nothing : ds13.Clear()
  292. DataGridView13.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  293. DataGridView13.ColumnHeadersHeight = 列高1 : DataGridView13.AllowUserToAddRows = False : DataGridView13.RowTemplate.Height = 列高
  294. SQL_排班系統_當天排班()
  295. da.Fill(ds13) : DataGridView13.DataSource = ds13.Tables(0) : conn.Close()
  296. DataGridView13.Columns(0).FillWeight = 欄寬1 : DataGridView13.Columns(1).FillWeight = 欄寬2
  297. End Sub
  298. Private Sub DataGridView13_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView13.RowPostPaint
  299. If 醫生_ch.Checked = True Then
  300. Dim linePen As New Pen(Color.Red, 2)
  301. If e.RowIndex = DataGridView13.Rows.Count - 1 Then : Exit Sub : Else
  302. If Strings.Mid(DataGridView13(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView13(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  303. Dim startX As Integer = IIf(DataGridView13.RowHeadersVisible, DataGridView13.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  304. Dim endX As Integer = startX + DataGridView13.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView13.HorizontalScrollingOffset
  305. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  306. End If
  307. End If
  308. End If
  309. End Sub
  310. Private Sub 讀取班別14()
  311. Dim ds14 As New DataSet : DataGridView14.DataSource = Nothing : ds14.Clear()
  312. DataGridView14.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  313. DataGridView14.ColumnHeadersHeight = 列高1 : DataGridView14.AllowUserToAddRows = False : DataGridView14.RowTemplate.Height = 列高
  314. SQL_排班系統_當天排班()
  315. da.Fill(ds14) : DataGridView14.DataSource = ds14.Tables(0) : conn.Close()
  316. DataGridView14.Columns(0).FillWeight = 欄寬1 : DataGridView14.Columns(1).FillWeight = 欄寬2
  317. End Sub
  318. Private Sub DataGridView14_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView14.RowPostPaint
  319. If 醫生_ch.Checked = True Then
  320. Dim linePen As New Pen(Color.Red, 2)
  321. If e.RowIndex = DataGridView14.Rows.Count - 1 Then : Exit Sub : Else
  322. If Strings.Mid(DataGridView14(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView14(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  323. Dim startX As Integer = IIf(DataGridView14.RowHeadersVisible, DataGridView14.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  324. Dim endX As Integer = startX + DataGridView14.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView14.HorizontalScrollingOffset
  325. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  326. End If
  327. End If
  328. End If
  329. End Sub
  330. Private Sub 讀取班別15()
  331. Dim ds15 As New DataSet : DataGridView15.DataSource = Nothing : ds15.Clear()
  332. DataGridView15.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  333. DataGridView15.ColumnHeadersHeight = 列高1 : DataGridView15.AllowUserToAddRows = False : DataGridView15.RowTemplate.Height = 列高
  334. SQL_排班系統_當天排班()
  335. da.Fill(ds15) : DataGridView15.DataSource = ds15.Tables(0) : conn.Close()
  336. DataGridView15.Columns(0).FillWeight = 欄寬1 : DataGridView15.Columns(1).FillWeight = 欄寬2
  337. End Sub
  338. Private Sub DataGridView15_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView15.RowPostPaint
  339. If 醫生_ch.Checked = True Then
  340. Dim linePen As New Pen(Color.Red, 2)
  341. If e.RowIndex = DataGridView15.Rows.Count - 1 Then : Exit Sub : Else
  342. If Strings.Mid(DataGridView15(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView15(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  343. Dim startX As Integer = IIf(DataGridView15.RowHeadersVisible, DataGridView15.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  344. Dim endX As Integer = startX + DataGridView15.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView15.HorizontalScrollingOffset
  345. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  346. End If
  347. End If
  348. End If
  349. End Sub
  350. Private Sub 讀取班別16()
  351. Dim ds16 As New DataSet : DataGridView16.DataSource = Nothing : ds16.Clear()
  352. DataGridView16.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  353. DataGridView16.ColumnHeadersHeight = 列高1 : DataGridView16.AllowUserToAddRows = False : DataGridView16.RowTemplate.Height = 列高
  354. SQL_排班系統_當天排班()
  355. da.Fill(ds16) : DataGridView16.DataSource = ds16.Tables(0) : conn.Close()
  356. DataGridView16.Columns(0).FillWeight = 欄寬1 : DataGridView16.Columns(1).FillWeight = 欄寬2
  357. End Sub
  358. Private Sub DataGridView16_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView16.RowPostPaint
  359. If 醫生_ch.Checked = True Then
  360. Dim linePen As New Pen(Color.Red, 2)
  361. If e.RowIndex = DataGridView16.Rows.Count - 1 Then : Exit Sub : Else
  362. If Strings.Mid(DataGridView16(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView16(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  363. Dim startX As Integer = IIf(DataGridView16.RowHeadersVisible, DataGridView16.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  364. Dim endX As Integer = startX + DataGridView16.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView16.HorizontalScrollingOffset
  365. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  366. End If
  367. End If
  368. End If
  369. End Sub
  370. Private Sub 讀取班別17()
  371. Dim ds17 As New DataSet : DataGridView17.DataSource = Nothing : ds17.Clear()
  372. DataGridView17.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  373. DataGridView17.ColumnHeadersHeight = 列高1 : DataGridView17.AllowUserToAddRows = False : DataGridView17.RowTemplate.Height = 列高
  374. SQL_排班系統_當天排班()
  375. da.Fill(ds17) : DataGridView17.DataSource = ds17.Tables(0) : conn.Close()
  376. DataGridView17.Columns(0).FillWeight = 欄寬1 : DataGridView17.Columns(1).FillWeight = 欄寬2
  377. End Sub
  378. Private Sub DataGridView17_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView17.RowPostPaint
  379. If 醫生_ch.Checked = True Then
  380. Dim linePen As New Pen(Color.Red, 2)
  381. If e.RowIndex = DataGridView17.Rows.Count - 1 Then : Exit Sub : Else
  382. If Strings.Mid(DataGridView17(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView17(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  383. Dim startX As Integer = IIf(DataGridView17.RowHeadersVisible, DataGridView17.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  384. Dim endX As Integer = startX + DataGridView17.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView17.HorizontalScrollingOffset
  385. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  386. End If
  387. End If
  388. End If
  389. End Sub
  390. Private Sub 讀取班別18()
  391. Dim ds18 As New DataSet : DataGridView18.DataSource = Nothing : ds18.Clear()
  392. DataGridView18.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  393. DataGridView18.ColumnHeadersHeight = 列高1 : DataGridView18.AllowUserToAddRows = False : DataGridView18.RowTemplate.Height = 列高
  394. SQL_排班系統_當天排班()
  395. da.Fill(ds18) : DataGridView18.DataSource = ds18.Tables(0) : conn.Close()
  396. DataGridView18.Columns(0).FillWeight = 欄寬1 : DataGridView18.Columns(1).FillWeight = 欄寬2
  397. End Sub
  398. Private Sub DataGridView18_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView18.RowPostPaint
  399. If 醫生_ch.Checked = True Then
  400. Dim linePen As New Pen(Color.Red, 2)
  401. If e.RowIndex = DataGridView18.Rows.Count - 1 Then : Exit Sub : Else
  402. If Strings.Mid(DataGridView18(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView18(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  403. Dim startX As Integer = IIf(DataGridView18.RowHeadersVisible, DataGridView18.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  404. Dim endX As Integer = startX + DataGridView18.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView18.HorizontalScrollingOffset
  405. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  406. End If
  407. End If
  408. End If
  409. End Sub
  410. Private Sub 讀取班別19()
  411. Dim ds19 As New DataSet : DataGridView19.DataSource = Nothing : ds19.Clear()
  412. DataGridView19.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  413. DataGridView19.ColumnHeadersHeight = 列高1 : DataGridView19.AllowUserToAddRows = False : DataGridView19.RowTemplate.Height = 列高
  414. SQL_排班系統_當天排班()
  415. da.Fill(ds19) : DataGridView19.DataSource = ds19.Tables(0) : conn.Close()
  416. DataGridView19.Columns(0).FillWeight = 欄寬1 : DataGridView19.Columns(1).FillWeight = 欄寬2
  417. End Sub
  418. Private Sub DataGridView19_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView19.RowPostPaint
  419. If 醫生_ch.Checked = True Then
  420. Dim linePen As New Pen(Color.Red, 2)
  421. If e.RowIndex = DataGridView19.Rows.Count - 1 Then : Exit Sub : Else
  422. If Strings.Mid(DataGridView19(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView19(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  423. Dim startX As Integer = IIf(DataGridView19.RowHeadersVisible, DataGridView19.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  424. Dim endX As Integer = startX + DataGridView19.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView19.HorizontalScrollingOffset
  425. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  426. End If
  427. End If
  428. End If
  429. End Sub
  430. Private Sub 讀取班別20()
  431. Dim ds20 As New DataSet : DataGridView20.DataSource = Nothing : ds20.Clear()
  432. DataGridView20.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  433. DataGridView20.ColumnHeadersHeight = 列高1 : DataGridView20.AllowUserToAddRows = False : DataGridView20.RowTemplate.Height = 列高
  434. SQL_排班系統_當天排班()
  435. da.Fill(ds20) : DataGridView20.DataSource = ds20.Tables(0) : conn.Close()
  436. DataGridView20.Columns(0).FillWeight = 欄寬1 : DataGridView20.Columns(1).FillWeight = 欄寬2
  437. End Sub
  438. Private Sub DataGridView20_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView20.RowPostPaint
  439. If 醫生_ch.Checked = True Then
  440. Dim linePen As New Pen(Color.Red, 2)
  441. If e.RowIndex = DataGridView20.Rows.Count - 1 Then : Exit Sub : Else
  442. If Strings.Mid(DataGridView20(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView20(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  443. Dim startX As Integer = IIf(DataGridView20.RowHeadersVisible, DataGridView20.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  444. Dim endX As Integer = startX + DataGridView20.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView20.HorizontalScrollingOffset
  445. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  446. End If
  447. End If
  448. End If
  449. End Sub
  450. Private Sub 讀取班別21()
  451. Dim ds21 As New DataSet : DataGridView21.DataSource = Nothing : ds21.Clear()
  452. DataGridView21.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  453. DataGridView21.ColumnHeadersHeight = 列高1 : DataGridView21.AllowUserToAddRows = False : DataGridView21.RowTemplate.Height = 列高
  454. SQL_排班系統_當天排班()
  455. da.Fill(ds21) : DataGridView21.DataSource = ds21.Tables(0) : conn.Close()
  456. DataGridView21.Columns(0).FillWeight = 欄寬1 : DataGridView21.Columns(1).FillWeight = 欄寬2
  457. End Sub
  458. Private Sub DataGridView21_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView21.RowPostPaint
  459. If 醫生_ch.Checked = True Then
  460. Dim linePen As New Pen(Color.Red, 2)
  461. If e.RowIndex = DataGridView21.Rows.Count - 1 Then : Exit Sub : Else
  462. If Strings.Mid(DataGridView21(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView21(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  463. Dim startX As Integer = IIf(DataGridView21.RowHeadersVisible, DataGridView21.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  464. Dim endX As Integer = startX + DataGridView21.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView21.HorizontalScrollingOffset
  465. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  466. End If
  467. End If
  468. End If
  469. End Sub
  470. Private Sub 讀取班別22()
  471. Dim ds22 As New DataSet : DataGridView22.DataSource = Nothing : ds22.Clear()
  472. DataGridView22.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  473. DataGridView22.ColumnHeadersHeight = 列高1 : DataGridView22.AllowUserToAddRows = False : DataGridView22.RowTemplate.Height = 列高
  474. SQL_排班系統_當天排班()
  475. da.Fill(ds22) : DataGridView22.DataSource = ds22.Tables(0) : conn.Close()
  476. DataGridView22.Columns(0).FillWeight = 欄寬1 : DataGridView22.Columns(1).FillWeight = 欄寬2
  477. End Sub
  478. Private Sub DataGridView22_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView22.RowPostPaint
  479. If 醫生_ch.Checked = True Then
  480. Dim linePen As New Pen(Color.Red, 2)
  481. If e.RowIndex = DataGridView22.Rows.Count - 1 Then : Exit Sub : Else
  482. If Strings.Mid(DataGridView22(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView22(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  483. Dim startX As Integer = IIf(DataGridView22.RowHeadersVisible, DataGridView22.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  484. Dim endX As Integer = startX + DataGridView22.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView22.HorizontalScrollingOffset
  485. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  486. End If
  487. End If
  488. End If
  489. End Sub
  490. Private Sub 讀取班別23()
  491. Dim ds23 As New DataSet : DataGridView23.DataSource = Nothing : ds23.Clear()
  492. DataGridView23.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  493. DataGridView23.ColumnHeadersHeight = 列高1 : DataGridView23.AllowUserToAddRows = False : DataGridView23.RowTemplate.Height = 列高
  494. SQL_排班系統_當天排班()
  495. da.Fill(ds23) : DataGridView23.DataSource = ds23.Tables(0) : conn.Close()
  496. DataGridView23.Columns(0).FillWeight = 欄寬1 : DataGridView23.Columns(1).FillWeight = 欄寬2
  497. End Sub
  498. Private Sub DataGridView23_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView23.RowPostPaint
  499. If 醫生_ch.Checked = True Then
  500. Dim linePen As New Pen(Color.Red, 2)
  501. If e.RowIndex = DataGridView23.Rows.Count - 1 Then : Exit Sub : Else
  502. If Strings.Mid(DataGridView23(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView23(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  503. Dim startX As Integer = IIf(DataGridView23.RowHeadersVisible, DataGridView23.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  504. Dim endX As Integer = startX + DataGridView23.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView23.HorizontalScrollingOffset
  505. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  506. End If
  507. End If
  508. End If
  509. End Sub
  510. Private Sub 讀取班別24()
  511. Dim ds24 As New DataSet : DataGridView24.DataSource = Nothing : ds24.Clear()
  512. DataGridView24.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  513. DataGridView24.ColumnHeadersHeight = 列高1 : DataGridView24.AllowUserToAddRows = False : DataGridView24.RowTemplate.Height = 列高
  514. SQL_排班系統_當天排班()
  515. da.Fill(ds24) : DataGridView24.DataSource = ds24.Tables(0) : conn.Close()
  516. DataGridView24.Columns(0).FillWeight = 欄寬1 : DataGridView24.Columns(1).FillWeight = 欄寬2
  517. End Sub
  518. Private Sub DataGridView24_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView24.RowPostPaint
  519. If 醫生_ch.Checked = True Then
  520. Dim linePen As New Pen(Color.Red, 2)
  521. If e.RowIndex = DataGridView24.Rows.Count - 1 Then : Exit Sub : Else
  522. If Strings.Mid(DataGridView24(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView24(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  523. Dim startX As Integer = IIf(DataGridView24.RowHeadersVisible, DataGridView24.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  524. Dim endX As Integer = startX + DataGridView24.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView24.HorizontalScrollingOffset
  525. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  526. End If
  527. End If
  528. End If
  529. End Sub
  530. Private Sub 讀取班別25()
  531. Dim ds25 As New DataSet : DataGridView25.DataSource = Nothing : ds25.Clear()
  532. DataGridView25.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  533. DataGridView25.ColumnHeadersHeight = 列高1 : DataGridView25.AllowUserToAddRows = False : DataGridView25.RowTemplate.Height = 列高
  534. SQL_排班系統_當天排班()
  535. da.Fill(ds25) : DataGridView25.DataSource = ds25.Tables(0) : conn.Close()
  536. DataGridView25.Columns(0).FillWeight = 欄寬1 : DataGridView25.Columns(1).FillWeight = 欄寬2
  537. End Sub
  538. Private Sub DataGridView25_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView25.RowPostPaint
  539. If 醫生_ch.Checked = True Then
  540. Dim linePen As New Pen(Color.Red, 2)
  541. If e.RowIndex = DataGridView25.Rows.Count - 1 Then : Exit Sub : Else
  542. If Strings.Mid(DataGridView25(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView25(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  543. Dim startX As Integer = IIf(DataGridView25.RowHeadersVisible, DataGridView25.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  544. Dim endX As Integer = startX + DataGridView25.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView25.HorizontalScrollingOffset
  545. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  546. End If
  547. End If
  548. End If
  549. End Sub
  550. Private Sub 讀取班別26()
  551. Dim ds26 As New DataSet : DataGridView26.DataSource = Nothing : ds26.Clear()
  552. DataGridView26.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  553. DataGridView26.ColumnHeadersHeight = 列高1 : DataGridView26.AllowUserToAddRows = False : DataGridView26.RowTemplate.Height = 列高
  554. SQL_排班系統_當天排班()
  555. da.Fill(ds26) : DataGridView26.DataSource = ds26.Tables(0) : conn.Close()
  556. DataGridView26.Columns(0).FillWeight = 欄寬1 : DataGridView26.Columns(1).FillWeight = 欄寬2
  557. End Sub
  558. Private Sub DataGridView26_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView26.RowPostPaint
  559. If 醫生_ch.Checked = True Then
  560. Dim linePen As New Pen(Color.Red, 2)
  561. If e.RowIndex = DataGridView26.Rows.Count - 1 Then : Exit Sub : Else
  562. If Strings.Mid(DataGridView26(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView26(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  563. Dim startX As Integer = IIf(DataGridView26.RowHeadersVisible, DataGridView26.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  564. Dim endX As Integer = startX + DataGridView26.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView26.HorizontalScrollingOffset
  565. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  566. End If
  567. End If
  568. End If
  569. End Sub
  570. Private Sub 讀取班別27()
  571. Dim ds27 As New DataSet : DataGridView27.DataSource = Nothing : ds27.Clear()
  572. DataGridView27.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  573. DataGridView27.ColumnHeadersHeight = 列高1 : DataGridView27.AllowUserToAddRows = False : DataGridView27.RowTemplate.Height = 列高
  574. SQL_排班系統_當天排班()
  575. da.Fill(ds27) : DataGridView27.DataSource = ds27.Tables(0) : conn.Close()
  576. DataGridView27.Columns(0).FillWeight = 欄寬1 : DataGridView27.Columns(1).FillWeight = 欄寬2
  577. End Sub
  578. Private Sub DataGridView27_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView27.RowPostPaint
  579. If 醫生_ch.Checked = True Then
  580. Dim linePen As New Pen(Color.Red, 2)
  581. If e.RowIndex = DataGridView27.Rows.Count - 1 Then : Exit Sub : Else
  582. If Strings.Mid(DataGridView27(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView27(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  583. Dim startX As Integer = IIf(DataGridView27.RowHeadersVisible, DataGridView27.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  584. Dim endX As Integer = startX + DataGridView27.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView27.HorizontalScrollingOffset
  585. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  586. End If
  587. End If
  588. End If
  589. End Sub
  590. Private Sub 讀取班別28()
  591. Dim ds28 As New DataSet : DataGridView28.DataSource = Nothing : ds28.Clear()
  592. DataGridView28.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  593. DataGridView28.ColumnHeadersHeight = 列高1 : DataGridView28.AllowUserToAddRows = False : DataGridView28.RowTemplate.Height = 列高
  594. SQL_排班系統_當天排班()
  595. da.Fill(ds28) : DataGridView28.DataSource = ds28.Tables(0) : conn.Close()
  596. DataGridView28.Columns(0).FillWeight = 欄寬1 : DataGridView28.Columns(1).FillWeight = 欄寬2
  597. End Sub
  598. Private Sub DataGridView28_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView28.RowPostPaint
  599. If 醫生_ch.Checked = True Then
  600. Dim linePen As New Pen(Color.Red, 2)
  601. If e.RowIndex = DataGridView28.Rows.Count - 1 Then : Exit Sub : Else
  602. If Strings.Mid(DataGridView28(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView28(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  603. Dim startX As Integer = IIf(DataGridView28.RowHeadersVisible, DataGridView28.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  604. Dim endX As Integer = startX + DataGridView28.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView28.HorizontalScrollingOffset
  605. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  606. End If
  607. End If
  608. End If
  609. End Sub
  610. Private Sub 讀取班別29()
  611. Dim ds29 As New DataSet : DataGridView29.DataSource = Nothing : ds29.Clear()
  612. DataGridView29.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  613. DataGridView29.ColumnHeadersHeight = 列高1 : DataGridView29.AllowUserToAddRows = False : DataGridView29.RowTemplate.Height = 列高
  614. SQL_排班系統_當天排班()
  615. da.Fill(ds29) : DataGridView29.DataSource = ds29.Tables(0) : conn.Close()
  616. DataGridView29.Columns(0).FillWeight = 欄寬1 : DataGridView29.Columns(1).FillWeight = 欄寬2
  617. End Sub
  618. Private Sub DataGridView29_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView29.RowPostPaint
  619. If 醫生_ch.Checked = True Then
  620. Dim linePen As New Pen(Color.Red, 2)
  621. If e.RowIndex = DataGridView29.Rows.Count - 1 Then : Exit Sub : Else
  622. If Strings.Mid(DataGridView29(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView29(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  623. Dim startX As Integer = IIf(DataGridView29.RowHeadersVisible, DataGridView29.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  624. Dim endX As Integer = startX + DataGridView29.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView29.HorizontalScrollingOffset
  625. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  626. End If
  627. End If
  628. End If
  629. End Sub
  630. Private Sub 讀取班別30()
  631. Dim ds30 As New DataSet : DataGridView30.DataSource = Nothing : ds30.Clear()
  632. DataGridView30.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  633. DataGridView30.ColumnHeadersHeight = 列高1 : DataGridView30.AllowUserToAddRows = False : DataGridView30.RowTemplate.Height = 列高
  634. SQL_排班系統_當天排班()
  635. da.Fill(ds30) : DataGridView30.DataSource = ds30.Tables(0) : conn.Close()
  636. DataGridView30.Columns(0).FillWeight = 欄寬1 : DataGridView30.Columns(1).FillWeight = 欄寬2
  637. End Sub
  638. Private Sub DataGridView30_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView30.RowPostPaint
  639. If 醫生_ch.Checked = True Then
  640. Dim linePen As New Pen(Color.Red, 2)
  641. If e.RowIndex = DataGridView30.Rows.Count - 1 Then : Exit Sub : Else
  642. If Strings.Mid(DataGridView30(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView30(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  643. Dim startX As Integer = IIf(DataGridView30.RowHeadersVisible, DataGridView30.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  644. Dim endX As Integer = startX + DataGridView30.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView30.HorizontalScrollingOffset
  645. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  646. End If
  647. End If
  648. End If
  649. End Sub
  650. Private Sub 讀取班別31()
  651. Dim ds31 As New DataSet : DataGridView31.DataSource = Nothing : ds31.Clear()
  652. DataGridView31.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  653. DataGridView31.ColumnHeadersHeight = 列高1 : DataGridView31.AllowUserToAddRows = False : DataGridView31.RowTemplate.Height = 列高
  654. SQL_排班系統_當天排班()
  655. da.Fill(ds31) : DataGridView31.DataSource = ds31.Tables(0) : conn.Close()
  656. DataGridView31.Columns(0).FillWeight = 欄寬1 : DataGridView31.Columns(1).FillWeight = 欄寬2
  657. End Sub
  658. Private Sub DataGridView31_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView31.RowPostPaint
  659. If 醫生_ch.Checked = True Then
  660. Dim linePen As New Pen(Color.Red, 2)
  661. If e.RowIndex = DataGridView31.Rows.Count - 1 Then : Exit Sub : Else
  662. If Strings.Mid(DataGridView31(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView31(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  663. Dim startX As Integer = IIf(DataGridView31.RowHeadersVisible, DataGridView31.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  664. Dim endX As Integer = startX + DataGridView31.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView31.HorizontalScrollingOffset
  665. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  666. End If
  667. End If
  668. End If
  669. End Sub
  670. Private Sub 讀取班別32()
  671. Dim ds32 As New DataSet : DataGridView32.DataSource = Nothing : ds32.Clear()
  672. DataGridView32.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  673. DataGridView32.ColumnHeadersHeight = 列高1 : DataGridView32.AllowUserToAddRows = False : DataGridView32.RowTemplate.Height = 列高
  674. SQL_排班系統_當天排班()
  675. da.Fill(ds32) : DataGridView32.DataSource = ds32.Tables(0) : conn.Close()
  676. DataGridView32.Columns(0).FillWeight = 欄寬1 : DataGridView32.Columns(1).FillWeight = 欄寬2
  677. End Sub
  678. Private Sub DataGridView32_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView32.RowPostPaint
  679. If 醫生_ch.Checked = True Then
  680. Dim linePen As New Pen(Color.Red, 2)
  681. If e.RowIndex = DataGridView32.Rows.Count - 1 Then : Exit Sub : Else
  682. If Strings.Mid(DataGridView32(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView32(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  683. Dim startX As Integer = IIf(DataGridView32.RowHeadersVisible, DataGridView32.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  684. Dim endX As Integer = startX + DataGridView32.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView32.HorizontalScrollingOffset
  685. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  686. End If
  687. End If
  688. End If
  689. End Sub
  690. Private Sub 讀取班別33()
  691. Dim ds33 As New DataSet : DataGridView33.DataSource = Nothing : ds33.Clear()
  692. DataGridView33.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  693. DataGridView33.ColumnHeadersHeight = 列高1 : DataGridView33.AllowUserToAddRows = False : DataGridView33.RowTemplate.Height = 列高
  694. SQL_排班系統_當天排班()
  695. da.Fill(ds33) : DataGridView33.DataSource = ds33.Tables(0) : conn.Close()
  696. DataGridView33.Columns(0).FillWeight = 欄寬1 : DataGridView33.Columns(1).FillWeight = 欄寬2
  697. End Sub
  698. Private Sub DataGridView33_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView33.RowPostPaint
  699. If 醫生_ch.Checked = True Then
  700. Dim linePen As New Pen(Color.Red, 2)
  701. If e.RowIndex = DataGridView33.Rows.Count - 1 Then : Exit Sub : Else
  702. If Strings.Mid(DataGridView33(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView33(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  703. Dim startX As Integer = IIf(DataGridView33.RowHeadersVisible, DataGridView33.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  704. Dim endX As Integer = startX + DataGridView33.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView33.HorizontalScrollingOffset
  705. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  706. End If
  707. End If
  708. End If
  709. End Sub
  710. Private Sub 讀取班別34()
  711. Dim ds34 As New DataSet : DataGridView34.DataSource = Nothing : ds34.Clear()
  712. DataGridView34.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  713. DataGridView34.ColumnHeadersHeight = 列高1 : DataGridView34.AllowUserToAddRows = False : DataGridView34.RowTemplate.Height = 列高
  714. SQL_排班系統_當天排班()
  715. da.Fill(ds34) : DataGridView34.DataSource = ds34.Tables(0) : conn.Close()
  716. DataGridView34.Columns(0).FillWeight = 欄寬1 : DataGridView34.Columns(1).FillWeight = 欄寬2
  717. End Sub
  718. Private Sub DataGridView34_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView34.RowPostPaint
  719. If 醫生_ch.Checked = True Then
  720. Dim linePen As New Pen(Color.Red, 2)
  721. If e.RowIndex = DataGridView34.Rows.Count - 1 Then : Exit Sub : Else
  722. If Strings.Mid(DataGridView34(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView34(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  723. Dim startX As Integer = IIf(DataGridView34.RowHeadersVisible, DataGridView34.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  724. Dim endX As Integer = startX + DataGridView34.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView34.HorizontalScrollingOffset
  725. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  726. End If
  727. End If
  728. End If
  729. End Sub
  730. Private Sub 讀取班別35()
  731. Dim ds35 As New DataSet : DataGridView35.DataSource = Nothing : ds35.Clear()
  732. DataGridView35.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  733. DataGridView35.ColumnHeadersHeight = 列高1 : DataGridView35.AllowUserToAddRows = False : DataGridView35.RowTemplate.Height = 列高
  734. SQL_排班系統_當天排班()
  735. da.Fill(ds35) : DataGridView35.DataSource = ds35.Tables(0) : conn.Close()
  736. DataGridView35.Columns(0).FillWeight = 欄寬1 : DataGridView35.Columns(1).FillWeight = 欄寬2
  737. End Sub
  738. Private Sub DataGridView35_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView35.RowPostPaint
  739. If 醫生_ch.Checked = True Then
  740. Dim linePen As New Pen(Color.Red, 2)
  741. If e.RowIndex = DataGridView35.Rows.Count - 1 Then : Exit Sub : Else
  742. If Strings.Mid(DataGridView35(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView35(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  743. Dim startX As Integer = IIf(DataGridView35.RowHeadersVisible, DataGridView35.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  744. Dim endX As Integer = startX + DataGridView35.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView35.HorizontalScrollingOffset
  745. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  746. End If
  747. End If
  748. End If
  749. End Sub
  750. Private Sub 讀取班別36()
  751. Dim ds36 As New DataSet : DataGridView36.DataSource = Nothing : ds36.Clear()
  752. DataGridView36.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  753. DataGridView36.ColumnHeadersHeight = 列高1 : DataGridView36.AllowUserToAddRows = False : DataGridView36.RowTemplate.Height = 列高
  754. SQL_排班系統_當天排班()
  755. da.Fill(ds36) : DataGridView36.DataSource = ds36.Tables(0) : conn.Close()
  756. DataGridView36.Columns(0).FillWeight = 欄寬1 : DataGridView36.Columns(1).FillWeight = 欄寬2
  757. End Sub
  758. Private Sub DataGridView36_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView36.RowPostPaint
  759. If 醫生_ch.Checked = True Then
  760. Dim linePen As New Pen(Color.Red, 2)
  761. If e.RowIndex = DataGridView36.Rows.Count - 1 Then : Exit Sub : Else
  762. If Strings.Mid(DataGridView36(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView36(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  763. Dim startX As Integer = IIf(DataGridView36.RowHeadersVisible, DataGridView36.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  764. Dim endX As Integer = startX + DataGridView36.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView36.HorizontalScrollingOffset
  765. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  766. End If
  767. End If
  768. End If
  769. End Sub
  770. Private Sub 讀取班別37()
  771. Dim ds37 As New DataSet : DataGridView37.DataSource = Nothing : ds37.Clear()
  772. DataGridView37.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  773. DataGridView37.ColumnHeadersHeight = 列高1 : DataGridView37.AllowUserToAddRows = False : DataGridView37.RowTemplate.Height = 列高
  774. SQL_排班系統_當天排班()
  775. da.Fill(ds37) : DataGridView37.DataSource = ds37.Tables(0) : conn.Close()
  776. DataGridView37.Columns(0).FillWeight = 欄寬1 : DataGridView37.Columns(1).FillWeight = 欄寬2
  777. End Sub
  778. Private Sub DataGridView37_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView37.RowPostPaint
  779. If 醫生_ch.Checked = True Then
  780. Dim linePen As New Pen(Color.Red, 2)
  781. If e.RowIndex = DataGridView37.Rows.Count - 1 Then : Exit Sub : Else
  782. If Strings.Mid(DataGridView37(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView37(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  783. Dim startX As Integer = IIf(DataGridView37.RowHeadersVisible, DataGridView37.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  784. Dim endX As Integer = startX + DataGridView37.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView37.HorizontalScrollingOffset
  785. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  786. End If
  787. End If
  788. End If
  789. End Sub
  790. Private Sub 讀取班別38()
  791. Dim ds38 As New DataSet : DataGridView38.DataSource = Nothing : ds38.Clear()
  792. DataGridView38.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  793. DataGridView38.ColumnHeadersHeight = 列高1 : DataGridView38.AllowUserToAddRows = False : DataGridView38.RowTemplate.Height = 列高
  794. SQL_排班系統_當天排班()
  795. da.Fill(ds38) : DataGridView38.DataSource = ds38.Tables(0) : conn.Close()
  796. DataGridView38.Columns(0).FillWeight = 欄寬1 : DataGridView38.Columns(1).FillWeight = 欄寬2
  797. End Sub
  798. Private Sub DataGridView38_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView38.RowPostPaint
  799. If 醫生_ch.Checked = True Then
  800. Dim linePen As New Pen(Color.Red, 2)
  801. If e.RowIndex = DataGridView38.Rows.Count - 1 Then : Exit Sub : Else
  802. If Strings.Mid(DataGridView38(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView38(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  803. Dim startX As Integer = IIf(DataGridView38.RowHeadersVisible, DataGridView38.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  804. Dim endX As Integer = startX + DataGridView38.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView38.HorizontalScrollingOffset
  805. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  806. End If
  807. End If
  808. End If
  809. End Sub
  810. Private Sub 讀取班別39()
  811. Dim ds39 As New DataSet : DataGridView39.DataSource = Nothing : ds39.Clear()
  812. DataGridView39.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  813. DataGridView39.ColumnHeadersHeight = 列高1 : DataGridView39.AllowUserToAddRows = False : DataGridView39.RowTemplate.Height = 列高
  814. SQL_排班系統_當天排班()
  815. da.Fill(ds39) : DataGridView39.DataSource = ds39.Tables(0) : conn.Close()
  816. DataGridView39.Columns(0).FillWeight = 欄寬1 : DataGridView39.Columns(1).FillWeight = 欄寬2
  817. End Sub
  818. Private Sub DataGridView39_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView39.RowPostPaint
  819. If 醫生_ch.Checked = True Then
  820. Dim linePen As New Pen(Color.Red, 2)
  821. If e.RowIndex = DataGridView39.Rows.Count - 1 Then : Exit Sub : Else
  822. If Strings.Mid(DataGridView39(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView39(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  823. Dim startX As Integer = IIf(DataGridView39.RowHeadersVisible, DataGridView39.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  824. Dim endX As Integer = startX + DataGridView39.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView39.HorizontalScrollingOffset
  825. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  826. End If
  827. End If
  828. End If
  829. End Sub
  830. Private Sub 讀取班別40()
  831. Dim ds40 As New DataSet : DataGridView40.DataSource = Nothing : ds40.Clear()
  832. DataGridView40.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  833. DataGridView40.ColumnHeadersHeight = 列高1 : DataGridView40.AllowUserToAddRows = False : DataGridView40.RowTemplate.Height = 列高
  834. SQL_排班系統_當天排班()
  835. da.Fill(ds40) : DataGridView40.DataSource = ds40.Tables(0) : conn.Close()
  836. DataGridView40.Columns(0).FillWeight = 欄寬1 : DataGridView40.Columns(1).FillWeight = 欄寬2
  837. End Sub
  838. Private Sub DataGridView40_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView40.RowPostPaint
  839. If 醫生_ch.Checked = True Then
  840. Dim linePen As New Pen(Color.Red, 2)
  841. If e.RowIndex = DataGridView40.Rows.Count - 1 Then : Exit Sub : Else
  842. If Strings.Mid(DataGridView40(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView40(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  843. Dim startX As Integer = IIf(DataGridView40.RowHeadersVisible, DataGridView40.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  844. Dim endX As Integer = startX + DataGridView40.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView40.HorizontalScrollingOffset
  845. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  846. End If
  847. End If
  848. End If
  849. End Sub
  850. Private Sub 讀取班別41()
  851. Dim ds41 As New DataSet : DataGridView41.DataSource = Nothing : ds41.Clear()
  852. DataGridView41.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  853. DataGridView41.ColumnHeadersHeight = 列高1 : DataGridView41.AllowUserToAddRows = False : DataGridView41.RowTemplate.Height = 列高
  854. SQL_排班系統_當天排班()
  855. da.Fill(ds41) : DataGridView41.DataSource = ds41.Tables(0) : conn.Close()
  856. DataGridView41.Columns(0).FillWeight = 欄寬1 : DataGridView41.Columns(1).FillWeight = 欄寬2
  857. End Sub
  858. Private Sub DataGridView41_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView41.RowPostPaint
  859. If 醫生_ch.Checked = True Then
  860. Dim linePen As New Pen(Color.Red, 2)
  861. If e.RowIndex = DataGridView41.Rows.Count - 1 Then : Exit Sub : Else
  862. If Strings.Mid(DataGridView41(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView41(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  863. Dim startX As Integer = IIf(DataGridView41.RowHeadersVisible, DataGridView41.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  864. Dim endX As Integer = startX + DataGridView41.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView41.HorizontalScrollingOffset
  865. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  866. End If
  867. End If
  868. End If
  869. End Sub
  870. Private Sub 讀取班別42()
  871. Dim ds42 As New DataSet : DataGridView42.DataSource = Nothing : ds42.Clear()
  872. DataGridView42.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  873. DataGridView42.ColumnHeadersHeight = 列高1 : DataGridView42.AllowUserToAddRows = False : DataGridView42.RowTemplate.Height = 列高
  874. SQL_排班系統_當天排班()
  875. da.Fill(ds42) : DataGridView42.DataSource = ds42.Tables(0) : conn.Close()
  876. DataGridView42.Columns(0).FillWeight = 欄寬1 : DataGridView42.Columns(1).FillWeight = 欄寬2
  877. End Sub
  878. Private Sub DataGridView42_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView42.RowPostPaint
  879. If 醫生_ch.Checked = True Then
  880. Dim linePen As New Pen(Color.Red, 2)
  881. If e.RowIndex = DataGridView42.Rows.Count - 1 Then : Exit Sub : Else
  882. If Strings.Mid(DataGridView42(0, e.RowIndex).Value.ToString, 4, 1) <> Strings.Mid(DataGridView42(0, e.RowIndex + 1).Value.ToString, 4, 1) Then
  883. Dim startX As Integer = IIf(DataGridView42.RowHeadersVisible, DataGridView42.RowHeadersWidth, 0) : Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  884. Dim endX As Integer = startX + DataGridView42.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView42.HorizontalScrollingOffset
  885. e.Graphics.DrawLine(linePen, startX, startY, endX, startY) : Exit Sub
  886. End If
  887. End If
  888. End If
  889. End Sub
  890. Private Sub 日曆變動()
  891. If 日期_dgv.Rows.Count > 0 Then
  892. 總時數 = 0
  893. For no As Integer = 1 To 42
  894. Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = True
  895. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label) : Labels.Text = "XX"
  896. Dim DataGridViewS As DataGridView = CType(Me.Controls.Find("DataGridView" + no.ToString(), True)(0), DataGridView) : DataGridViewS.DataSource = Nothing
  897. Next
  898. Dim Q As Integer = 0
  899. 星期 = 日期_dgv.Rows(0).Cells("星期").Value.ToString : 天數 = 日期_dgv.Rows.Count
  900. If 星期 = "星期日" Then
  901. For no As Integer = 1 To 42
  902. If no > 天數 Then : Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  903. Dim 日期_lb As System.Windows.Forms.Label = CType(Me.Controls.Find("日期_lb" + no.ToString(), True)(0), System.Windows.Forms.Label) : 日期_lb.Text = no
  904. If IsNumeric(Val(日期_lb.Text)) = True Then
  905. If no < 10 Then : PA = "0" & no : Else : PA = no : End If : PA = 年份_cb.Text & "/" & 月份_cb.Text & "/" & PA
  906. If no = 1 Then : 讀取班別1() : ElseIf no = 2 Then : 讀取班別2() : ElseIf no = 3 Then : 讀取班別3() : ElseIf no = 4 Then : 讀取班別4()
  907. ElseIf no = 5 Then : 讀取班別5() : ElseIf no = 6 Then : 讀取班別6() : ElseIf no = 7 Then : 讀取班別7() : ElseIf no = 8 Then : 讀取班別8()
  908. ElseIf no = 9 Then : 讀取班別9() : ElseIf no = 10 Then : 讀取班別10() : ElseIf no = 11 Then : 讀取班別11() : ElseIf no = 12 Then : 讀取班別12()
  909. ElseIf no = 13 Then : 讀取班別13() : ElseIf no = 14 Then : 讀取班別14() : ElseIf no = 15 Then : 讀取班別15() : ElseIf no = 16 Then : 讀取班別16()
  910. ElseIf no = 17 Then : 讀取班別17() : ElseIf no = 18 Then : 讀取班別18() : ElseIf no = 19 Then : 讀取班別19() : ElseIf no = 20 Then : 讀取班別20()
  911. ElseIf no = 21 Then : 讀取班別21() : ElseIf no = 22 Then : 讀取班別22() : ElseIf no = 23 Then : 讀取班別23() : ElseIf no = 24 Then : 讀取班別24()
  912. ElseIf no = 25 Then : 讀取班別25() : ElseIf no = 26 Then : 讀取班別26() : ElseIf no = 27 Then : 讀取班別27() : ElseIf no = 28 Then : 讀取班別28()
  913. ElseIf no = 29 Then : 讀取班別29() : ElseIf no = 30 Then : 讀取班別30() : ElseIf no = 31 Then : 讀取班別31() : ElseIf no = 32 Then : 讀取班別32()
  914. ElseIf no = 33 Then : 讀取班別33() : ElseIf no = 34 Then : 讀取班別34() : ElseIf no = 35 Then : 讀取班別35() : ElseIf no = 36 Then : 讀取班別36()
  915. ElseIf no = 37 Then : 讀取班別37() : ElseIf no = 38 Then : 讀取班別38() : ElseIf no = 39 Then : 讀取班別39() : ElseIf no = 40 Then : 讀取班別40()
  916. ElseIf no = 41 Then : 讀取班別41() : ElseIf no = 42 Then : 讀取班別42() : End If
  917. End If
  918. If no >= 1 And no <= 天數 Then
  919. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label)
  920. Labels.Text = 日期_dgv.Rows(Q).Cells("休假").Value.ToString
  921. If 日期_dgv.Rows(Q).Cells("休假").Value.ToString <> "國定假日" And 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期日" And
  922. 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期六" Then
  923. 總時數 += 8
  924. End If : Q += 1
  925. End If
  926. Next
  927. End If
  928. If 星期 = "星期一" Then
  929. For no As Integer = 1 To 42
  930. If no = 1 Then
  931. Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  932. If no > 天數 + 1 Then : Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  933. Dim 日期_lb As System.Windows.Forms.Label = CType(Me.Controls.Find("日期_lb" + no.ToString(), True)(0), System.Windows.Forms.Label) : 日期_lb.Text = no - 1
  934. If IsNumeric(Val(日期_lb.Text)) = True Then
  935. If no - 1 < 10 Then : PA = "0" & no - 1 : Else : PA = no - 1 : End If : PA = 年份_cb.Text & "/" & 月份_cb.Text & "/" & PA
  936. If no = 1 Then : 讀取班別1() : ElseIf no = 2 Then : 讀取班別2() : ElseIf no = 3 Then : 讀取班別3() : ElseIf no = 4 Then : 讀取班別4()
  937. ElseIf no = 5 Then : 讀取班別5() : ElseIf no = 6 Then : 讀取班別6() : ElseIf no = 7 Then : 讀取班別7() : ElseIf no = 8 Then : 讀取班別8()
  938. ElseIf no = 9 Then : 讀取班別9() : ElseIf no = 10 Then : 讀取班別10() : ElseIf no = 11 Then : 讀取班別11() : ElseIf no = 12 Then : 讀取班別12()
  939. ElseIf no = 13 Then : 讀取班別13() : ElseIf no = 14 Then : 讀取班別14() : ElseIf no = 15 Then : 讀取班別15() : ElseIf no = 16 Then : 讀取班別16()
  940. ElseIf no = 17 Then : 讀取班別17() : ElseIf no = 18 Then : 讀取班別18() : ElseIf no = 19 Then : 讀取班別19() : ElseIf no = 20 Then : 讀取班別20()
  941. ElseIf no = 21 Then : 讀取班別21() : ElseIf no = 22 Then : 讀取班別22() : ElseIf no = 23 Then : 讀取班別23() : ElseIf no = 24 Then : 讀取班別24()
  942. ElseIf no = 25 Then : 讀取班別25() : ElseIf no = 26 Then : 讀取班別26() : ElseIf no = 27 Then : 讀取班別27() : ElseIf no = 28 Then : 讀取班別28()
  943. ElseIf no = 29 Then : 讀取班別29() : ElseIf no = 30 Then : 讀取班別30() : ElseIf no = 31 Then : 讀取班別31() : ElseIf no = 32 Then : 讀取班別32()
  944. ElseIf no = 33 Then : 讀取班別33() : ElseIf no = 34 Then : 讀取班別34() : ElseIf no = 35 Then : 讀取班別35() : ElseIf no = 36 Then : 讀取班別36()
  945. ElseIf no = 37 Then : 讀取班別37() : ElseIf no = 38 Then : 讀取班別38() : ElseIf no = 39 Then : 讀取班別39() : ElseIf no = 40 Then : 讀取班別40()
  946. ElseIf no = 41 Then : 讀取班別41() : ElseIf no = 42 Then : 讀取班別42() : End If
  947. End If
  948. If no >= 2 And no <= 天數 + 1 Then
  949. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label)
  950. Labels.Text = 日期_dgv.Rows(Q).Cells("休假").Value.ToString
  951. If 日期_dgv.Rows(Q).Cells("休假").Value.ToString <> "國定假日" And 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期日" And
  952. 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期六" Then
  953. 總時數 += 8
  954. End If : Q += 1
  955. End If
  956. Next
  957. End If
  958. If 星期 = "星期二" Then
  959. For no As Integer = 1 To 42
  960. If no = 1 Or no = 2 Then
  961. Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  962. If no > 天數 + 2 Then : Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  963. Dim 日期_lb As System.Windows.Forms.Label = CType(Me.Controls.Find("日期_lb" + no.ToString(), True)(0), System.Windows.Forms.Label) : 日期_lb.Text = no - 2
  964. If IsNumeric(Val(日期_lb.Text)) = True Then
  965. If no - 2 < 10 Then : PA = "0" & no - 2 : Else : PA = no - 2 : End If : PA = 年份_cb.Text & "/" & 月份_cb.Text & "/" & PA
  966. If no = 1 Then : 讀取班別1() : ElseIf no = 2 Then : 讀取班別2() : ElseIf no = 3 Then : 讀取班別3() : ElseIf no = 4 Then : 讀取班別4()
  967. ElseIf no = 5 Then : 讀取班別5() : ElseIf no = 6 Then : 讀取班別6() : ElseIf no = 7 Then : 讀取班別7() : ElseIf no = 8 Then : 讀取班別8()
  968. ElseIf no = 9 Then : 讀取班別9() : ElseIf no = 10 Then : 讀取班別10() : ElseIf no = 11 Then : 讀取班別11() : ElseIf no = 12 Then : 讀取班別12()
  969. ElseIf no = 13 Then : 讀取班別13() : ElseIf no = 14 Then : 讀取班別14() : ElseIf no = 15 Then : 讀取班別15() : ElseIf no = 16 Then : 讀取班別16()
  970. ElseIf no = 17 Then : 讀取班別17() : ElseIf no = 18 Then : 讀取班別18() : ElseIf no = 19 Then : 讀取班別19() : ElseIf no = 20 Then : 讀取班別20()
  971. ElseIf no = 21 Then : 讀取班別21() : ElseIf no = 22 Then : 讀取班別22() : ElseIf no = 23 Then : 讀取班別23() : ElseIf no = 24 Then : 讀取班別24()
  972. ElseIf no = 25 Then : 讀取班別25() : ElseIf no = 26 Then : 讀取班別26() : ElseIf no = 27 Then : 讀取班別27() : ElseIf no = 28 Then : 讀取班別28()
  973. ElseIf no = 29 Then : 讀取班別29() : ElseIf no = 30 Then : 讀取班別30() : ElseIf no = 31 Then : 讀取班別31() : ElseIf no = 32 Then : 讀取班別32()
  974. ElseIf no = 33 Then : 讀取班別33() : ElseIf no = 34 Then : 讀取班別34() : ElseIf no = 35 Then : 讀取班別35() : ElseIf no = 36 Then : 讀取班別36()
  975. ElseIf no = 37 Then : 讀取班別37() : ElseIf no = 38 Then : 讀取班別38() : ElseIf no = 39 Then : 讀取班別39() : ElseIf no = 40 Then : 讀取班別40()
  976. ElseIf no = 41 Then : 讀取班別41() : ElseIf no = 42 Then : 讀取班別42() : End If
  977. End If
  978. If no >= 3 And no <= 天數 + 2 Then
  979. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label)
  980. Labels.Text = 日期_dgv.Rows(Q).Cells("休假").Value.ToString
  981. If 日期_dgv.Rows(Q).Cells("休假").Value.ToString <> "國定假日" And 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期日" And
  982. 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期六" Then
  983. 總時數 += 8
  984. End If : Q += 1
  985. End If
  986. Next
  987. End If
  988. If 星期 = "星期三" Then
  989. For no As Integer = 1 To 42
  990. If no = 1 Or no = 2 Or no = 3 Then
  991. Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  992. If no > 天數 + 3 Then : Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  993. Dim 日期_lb As System.Windows.Forms.Label = CType(Me.Controls.Find("日期_lb" + no.ToString(), True)(0), System.Windows.Forms.Label) : 日期_lb.Text = no - 3
  994. If IsNumeric(Val(日期_lb.Text)) = True Then
  995. If no - 3 < 10 Then : PA = "0" & no - 3 : Else : PA = no - 3 : End If : PA = 年份_cb.Text & "/" & 月份_cb.Text & "/" & PA
  996. If no = 1 Then : 讀取班別1() : ElseIf no = 2 Then : 讀取班別2() : ElseIf no = 3 Then : 讀取班別3() : ElseIf no = 4 Then : 讀取班別4()
  997. ElseIf no = 5 Then : 讀取班別5() : ElseIf no = 6 Then : 讀取班別6() : ElseIf no = 7 Then : 讀取班別7() : ElseIf no = 8 Then : 讀取班別8()
  998. ElseIf no = 9 Then : 讀取班別9() : ElseIf no = 10 Then : 讀取班別10() : ElseIf no = 11 Then : 讀取班別11() : ElseIf no = 12 Then : 讀取班別12()
  999. ElseIf no = 13 Then : 讀取班別13() : ElseIf no = 14 Then : 讀取班別14() : ElseIf no = 15 Then : 讀取班別15() : ElseIf no = 16 Then : 讀取班別16()
  1000. ElseIf no = 17 Then : 讀取班別17() : ElseIf no = 18 Then : 讀取班別18() : ElseIf no = 19 Then : 讀取班別19() : ElseIf no = 20 Then : 讀取班別20()
  1001. ElseIf no = 21 Then : 讀取班別21() : ElseIf no = 22 Then : 讀取班別22() : ElseIf no = 23 Then : 讀取班別23() : ElseIf no = 24 Then : 讀取班別24()
  1002. ElseIf no = 25 Then : 讀取班別25() : ElseIf no = 26 Then : 讀取班別26() : ElseIf no = 27 Then : 讀取班別27() : ElseIf no = 28 Then : 讀取班別28()
  1003. ElseIf no = 29 Then : 讀取班別29() : ElseIf no = 30 Then : 讀取班別30() : ElseIf no = 31 Then : 讀取班別31() : ElseIf no = 32 Then : 讀取班別32()
  1004. ElseIf no = 33 Then : 讀取班別33() : ElseIf no = 34 Then : 讀取班別34() : ElseIf no = 35 Then : 讀取班別35() : ElseIf no = 36 Then : 讀取班別36()
  1005. ElseIf no = 37 Then : 讀取班別37() : ElseIf no = 38 Then : 讀取班別38() : ElseIf no = 39 Then : 讀取班別39() : ElseIf no = 40 Then : 讀取班別40()
  1006. ElseIf no = 41 Then : 讀取班別41() : ElseIf no = 42 Then : 讀取班別42() : End If
  1007. End If
  1008. If no >= 4 And no <= 天數 + 3 Then
  1009. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label)
  1010. Labels.Text = 日期_dgv.Rows(Q).Cells("休假").Value.ToString
  1011. If 日期_dgv.Rows(Q).Cells("休假").Value.ToString <> "國定假日" And 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期日" And
  1012. 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期六" Then
  1013. 總時數 += 8
  1014. End If : Q += 1
  1015. End If
  1016. Next
  1017. End If
  1018. If 星期 = "星期四" Then
  1019. For no As Integer = 1 To 42
  1020. If no = 1 Or no = 2 Or no = 3 Or no = 4 Then
  1021. Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  1022. If no > 天數 + 4 Then : Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  1023. Dim 日期_lb As System.Windows.Forms.Label = CType(Me.Controls.Find("日期_lb" + no.ToString(), True)(0), System.Windows.Forms.Label) : 日期_lb.Text = no - 4
  1024. If IsNumeric(Val(日期_lb.Text)) = True Then
  1025. If no - 4 < 10 Then : PA = "0" & no - 4 : Else : PA = no - 4 : End If : PA = 年份_cb.Text & "/" & 月份_cb.Text & "/" & PA
  1026. If no = 1 Then : 讀取班別1() : ElseIf no = 2 Then : 讀取班別2() : ElseIf no = 3 Then : 讀取班別3() : ElseIf no = 4 Then : 讀取班別4()
  1027. ElseIf no = 5 Then : 讀取班別5() : ElseIf no = 6 Then : 讀取班別6() : ElseIf no = 7 Then : 讀取班別7() : ElseIf no = 8 Then : 讀取班別8()
  1028. ElseIf no = 9 Then : 讀取班別9() : ElseIf no = 10 Then : 讀取班別10() : ElseIf no = 11 Then : 讀取班別11() : ElseIf no = 12 Then : 讀取班別12()
  1029. ElseIf no = 13 Then : 讀取班別13() : ElseIf no = 14 Then : 讀取班別14() : ElseIf no = 15 Then : 讀取班別15() : ElseIf no = 16 Then : 讀取班別16()
  1030. ElseIf no = 17 Then : 讀取班別17() : ElseIf no = 18 Then : 讀取班別18() : ElseIf no = 19 Then : 讀取班別19() : ElseIf no = 20 Then : 讀取班別20()
  1031. ElseIf no = 21 Then : 讀取班別21() : ElseIf no = 22 Then : 讀取班別22() : ElseIf no = 23 Then : 讀取班別23() : ElseIf no = 24 Then : 讀取班別24()
  1032. ElseIf no = 25 Then : 讀取班別25() : ElseIf no = 26 Then : 讀取班別26() : ElseIf no = 27 Then : 讀取班別27() : ElseIf no = 28 Then : 讀取班別28()
  1033. ElseIf no = 29 Then : 讀取班別29() : ElseIf no = 30 Then : 讀取班別30() : ElseIf no = 31 Then : 讀取班別31() : ElseIf no = 32 Then : 讀取班別32()
  1034. ElseIf no = 33 Then : 讀取班別33() : ElseIf no = 34 Then : 讀取班別34() : ElseIf no = 35 Then : 讀取班別35() : ElseIf no = 36 Then : 讀取班別36()
  1035. ElseIf no = 37 Then : 讀取班別37() : ElseIf no = 38 Then : 讀取班別38() : ElseIf no = 39 Then : 讀取班別39() : ElseIf no = 40 Then : 讀取班別40()
  1036. ElseIf no = 41 Then : 讀取班別41() : ElseIf no = 42 Then : 讀取班別42() : End If
  1037. End If
  1038. If no >= 5 And no <= 天數 + 4 Then
  1039. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label)
  1040. Labels.Text = 日期_dgv.Rows(Q).Cells("休假").Value.ToString
  1041. If 日期_dgv.Rows(Q).Cells("休假").Value.ToString <> "國定假日" And 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期日" And
  1042. 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期六" Then
  1043. 總時數 += 8
  1044. End If : Q += 1
  1045. End If
  1046. Next
  1047. End If
  1048. If 星期 = "星期五" Then
  1049. For no As Integer = 1 To 42
  1050. If no = 1 Or no = 2 Or no = 3 Or no = 4 Or no = 5 Then
  1051. Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  1052. If no > 天數 + 5 Then : Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  1053. Dim 日期_lb As System.Windows.Forms.Label = CType(Me.Controls.Find("日期_lb" + no.ToString(), True)(0), System.Windows.Forms.Label) : 日期_lb.Text = no - 5
  1054. If IsNumeric(Val(日期_lb.Text)) = True Then
  1055. If no - 5 < 10 Then : PA = "0" & Math.Abs(no - 5) : Else : PA = Math.Abs(no - 5) : End If : PA = 年份_cb.Text & "/" & 月份_cb.Text & "/" & PA
  1056. If no = 1 Then : 讀取班別1() : ElseIf no = 2 Then : 讀取班別2() : ElseIf no = 3 Then : 讀取班別3() : ElseIf no = 4 Then : 讀取班別4()
  1057. ElseIf no = 5 Then : 讀取班別5() : ElseIf no = 6 Then : 讀取班別6() : ElseIf no = 7 Then : 讀取班別7() : ElseIf no = 8 Then : 讀取班別8()
  1058. ElseIf no = 9 Then : 讀取班別9() : ElseIf no = 10 Then : 讀取班別10() : ElseIf no = 11 Then : 讀取班別11() : ElseIf no = 12 Then : 讀取班別12()
  1059. ElseIf no = 13 Then : 讀取班別13() : ElseIf no = 14 Then : 讀取班別14() : ElseIf no = 15 Then : 讀取班別15() : ElseIf no = 16 Then : 讀取班別16()
  1060. ElseIf no = 17 Then : 讀取班別17() : ElseIf no = 18 Then : 讀取班別18() : ElseIf no = 19 Then : 讀取班別19() : ElseIf no = 20 Then : 讀取班別20()
  1061. ElseIf no = 21 Then : 讀取班別21() : ElseIf no = 22 Then : 讀取班別22() : ElseIf no = 23 Then : 讀取班別23() : ElseIf no = 24 Then : 讀取班別24()
  1062. ElseIf no = 25 Then : 讀取班別25() : ElseIf no = 26 Then : 讀取班別26() : ElseIf no = 27 Then : 讀取班別27() : ElseIf no = 28 Then : 讀取班別28()
  1063. ElseIf no = 29 Then : 讀取班別29() : ElseIf no = 30 Then : 讀取班別30() : ElseIf no = 31 Then : 讀取班別31() : ElseIf no = 32 Then : 讀取班別32()
  1064. ElseIf no = 33 Then : 讀取班別33() : ElseIf no = 34 Then : 讀取班別34() : ElseIf no = 35 Then : 讀取班別35() : ElseIf no = 36 Then : 讀取班別36()
  1065. ElseIf no = 37 Then : 讀取班別37() : ElseIf no = 38 Then : 讀取班別38() : ElseIf no = 39 Then : 讀取班別39() : ElseIf no = 40 Then : 讀取班別40()
  1066. ElseIf no = 41 Then : 讀取班別41() : ElseIf no = 42 Then : 讀取班別42() : End If
  1067. End If
  1068. If no >= 6 And no <= 天數 + 5 Then
  1069. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label)
  1070. Labels.Text = 日期_dgv.Rows(Q).Cells("休假").Value.ToString
  1071. If 日期_dgv.Rows(Q).Cells("休假").Value.ToString <> "國定假日" And 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期日" And
  1072. 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期六" Then
  1073. 總時數 += 8
  1074. End If : Q += 1
  1075. End If
  1076. Next
  1077. End If
  1078. If 星期 = "星期六" Then
  1079. For no As Integer = 1 To 42
  1080. If no = 1 Or no = 2 Or no = 3 Or no = 4 Or no = 5 Or no = 6 Then
  1081. Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  1082. If no > 天數 + 6 Then : Dim Panels As Panel = CType(Me.Controls.Find("Panel" + no.ToString(), True)(0), Panel) : Panels.Visible = False : End If
  1083. Dim 日期_lb As System.Windows.Forms.Label = CType(Me.Controls.Find("日期_lb" + no.ToString(), True)(0), System.Windows.Forms.Label) : 日期_lb.Text = no - 6
  1084. If IsNumeric(Val(日期_lb.Text)) = True Then
  1085. If no - 6 < 10 Then : PA = "0" & no - 6 : Else : PA = no - 6 : End If : PA = 年份_cb.Text & "/" & 月份_cb.Text & "/" & PA
  1086. If no = 1 Then : 讀取班別1() : ElseIf no = 2 Then : 讀取班別2() : ElseIf no = 3 Then : 讀取班別3() : ElseIf no = 4 Then : 讀取班別4()
  1087. ElseIf no = 5 Then : 讀取班別5() : ElseIf no = 6 Then : 讀取班別6() : ElseIf no = 7 Then : 讀取班別7() : ElseIf no = 8 Then : 讀取班別8()
  1088. ElseIf no = 9 Then : 讀取班別9() : ElseIf no = 10 Then : 讀取班別10() : ElseIf no = 11 Then : 讀取班別11() : ElseIf no = 12 Then : 讀取班別12()
  1089. ElseIf no = 13 Then : 讀取班別13() : ElseIf no = 14 Then : 讀取班別14() : ElseIf no = 15 Then : 讀取班別15() : ElseIf no = 16 Then : 讀取班別16()
  1090. ElseIf no = 17 Then : 讀取班別17() : ElseIf no = 18 Then : 讀取班別18() : ElseIf no = 19 Then : 讀取班別19() : ElseIf no = 20 Then : 讀取班別20()
  1091. ElseIf no = 21 Then : 讀取班別21() : ElseIf no = 22 Then : 讀取班別22() : ElseIf no = 23 Then : 讀取班別23() : ElseIf no = 24 Then : 讀取班別24()
  1092. ElseIf no = 25 Then : 讀取班別25() : ElseIf no = 26 Then : 讀取班別26() : ElseIf no = 27 Then : 讀取班別27() : ElseIf no = 28 Then : 讀取班別28()
  1093. ElseIf no = 29 Then : 讀取班別29() : ElseIf no = 30 Then : 讀取班別30() : ElseIf no = 31 Then : 讀取班別31() : ElseIf no = 32 Then : 讀取班別32()
  1094. ElseIf no = 33 Then : 讀取班別33() : ElseIf no = 34 Then : 讀取班別34() : ElseIf no = 35 Then : 讀取班別35() : ElseIf no = 36 Then : 讀取班別36()
  1095. ElseIf no = 37 Then : 讀取班別37() : ElseIf no = 38 Then : 讀取班別38() : ElseIf no = 39 Then : 讀取班別39() : ElseIf no = 40 Then : 讀取班別40()
  1096. ElseIf no = 41 Then : 讀取班別41() : ElseIf no = 42 Then : 讀取班別42() : End If
  1097. End If
  1098. If no >= 7 And no <= 天數 + 6 Then
  1099. Dim Labels As System.Windows.Forms.Label = CType(Me.Controls.Find("Label" + no.ToString(), True)(0), System.Windows.Forms.Label)
  1100. Labels.Text = 日期_dgv.Rows(Q).Cells("休假").Value.ToString
  1101. If 日期_dgv.Rows(Q).Cells("休假").Value.ToString <> "國定假日" And 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期日" And
  1102. 日期_dgv.Rows(Q).Cells("星期").Value.ToString <> "星期六" Then
  1103. 總時數 += 8
  1104. End If : Q += 1
  1105. End If
  1106. Next
  1107. End If
  1108. End If
  1109. End Sub
  1110. Private Sub 排班資料_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  1111. Me.MdiParent = GRAMS_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  1112. 列高 = 17 : 列高1 = 22 : 欄寬1 = 80 : 欄寬2 = 200
  1113. 年份_下拉表單資料載入() : 日期_dgv.Visible = False
  1114. 首次開啟 = False
  1115. 年份_cb.Text = Year(Today) : 月份_cb.SelectedIndex = Month(Today) - 1
  1116. PA1 = 年份_cb.Text : PA2 = 月份_cb.Text
  1117. 首次開啟 = True
  1118. 讀取日期() : 日曆變動()
  1119. PA = 年份_cb.Text & "/" & 月份_cb.Text
  1120. 讀取排班()
  1121. For i As Integer = 0 To 人員彙總_dgv.Rows.Count - 1
  1122. 人員彙總_dgv.Rows(i).Cells("本月應上時數").Value = 總時數
  1123. 人員彙總_dgv.Rows(i).Cells("未排班時數").Value = 人員彙總_dgv.Rows(i).Cells("本月應上時數").Value - 人員彙總_dgv.Rows(i).Cells("已排班時數").Value
  1124. Next
  1125. End Sub
  1126. Private Sub 人員彙總_dgv_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles 人員彙總_dgv.CellClick
  1127. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 人員彙總_dgv.Rows(e.RowIndex).Cells("姓名").Value : 個人班表.Close() : 個人班表.Show() : 個人班表.BringToFront()
  1128. End Sub
  1129. Private Sub 月份_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 月份_cb.SelectedIndexChanged
  1130. If 首次開啟 = True Then
  1131. PA1 = 年份_cb.Text : PA2 = 月份_cb.Text : 讀取日期() : 日曆變動()
  1132. PA = 年份_cb.Text & "/" & 月份_cb.Text : 讀取排班()
  1133. For i As Integer = 0 To 人員彙總_dgv.Rows.Count - 1
  1134. 人員彙總_dgv.Rows(i).Cells("本月應上時數").Value = 總時數
  1135. 人員彙總_dgv.Rows(i).Cells("未排班時數").Value = 人員彙總_dgv.Rows(i).Cells("本月應上時數").Value - 人員彙總_dgv.Rows(i).Cells("已排班時數").Value
  1136. Next
  1137. End If
  1138. End Sub
  1139. Private Sub 重新讀取_bt_Click(sender As Object, e As EventArgs) Handles 重新讀取_bt.Click
  1140. PA1 = 年份_cb.Text : PA2 = 月份_cb.Text : 讀取日期() : 日曆變動()
  1141. PA = 年份_cb.Text & "/" & 月份_cb.Text : 讀取排班()
  1142. For i As Integer = 0 To 人員彙總_dgv.Rows.Count - 1
  1143. 人員彙總_dgv.Rows(i).Cells("本月應上時數").Value = 總時數
  1144. 人員彙總_dgv.Rows(i).Cells("未排班時數").Value = 人員彙總_dgv.Rows(i).Cells("本月應上時數").Value - 人員彙總_dgv.Rows(i).Cells("已排班時數").Value
  1145. Next
  1146. End Sub
  1147. Private Sub 醫生_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 醫生_ch.Click
  1148. 醫生_ch.Checked = True : 職員_ch.Checked = False : 請休假_ch.Checked = False : 日曆變動()
  1149. End Sub
  1150. Private Sub 職員_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 職員_ch.Click
  1151. 醫生_ch.Checked = False : 職員_ch.Checked = True : 請休假_ch.Checked = False : 日曆變動()
  1152. End Sub
  1153. Private Sub 請休假_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 請休假_ch.Click
  1154. 醫生_ch.Checked = False : 職員_ch.Checked = False : 請休假_ch.Checked = True : 日曆變動()
  1155. End Sub
  1156. Private Sub B01_tb_Click(sender As Object, e As EventArgs) Handles B01_tb.Click
  1157. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb1.Text : 排班明細.Show()
  1158. End Sub
  1159. Private Sub B02_tb_Click(sender As Object, e As EventArgs) Handles B02_tb.Click
  1160. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb2.Text : 排班明細.Show()
  1161. End Sub
  1162. Private Sub B03_tb_Click(sender As Object, e As EventArgs) Handles B03_tb.Click
  1163. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb3.Text : 排班明細.Show()
  1164. End Sub
  1165. Private Sub B04_tb_Click(sender As Object, e As EventArgs) Handles B04_tb.Click
  1166. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb4.Text : 排班明細.Show()
  1167. End Sub
  1168. Private Sub B05_tb_Click(sender As Object, e As EventArgs) Handles B05_tb.Click
  1169. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb5.Text : 排班明細.Show()
  1170. End Sub
  1171. Private Sub B06_tb_Click(sender As Object, e As EventArgs) Handles B06_tb.Click
  1172. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb6.Text : 排班明細.Show()
  1173. End Sub
  1174. Private Sub B07_tb_Click(sender As Object, e As EventArgs) Handles B07_tb.Click
  1175. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb7.Text : 排班明細.Show()
  1176. End Sub
  1177. Private Sub B08_tb_Click(sender As Object, e As EventArgs) Handles B08_tb.Click
  1178. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb8.Text : 排班明細.Show()
  1179. End Sub
  1180. Private Sub B09_tb_Click(sender As Object, e As EventArgs) Handles B09_tb.Click
  1181. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb9.Text : 排班明細.Show()
  1182. End Sub
  1183. Private Sub B10_tb_Click(sender As Object, e As EventArgs) Handles B10_tb.Click
  1184. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb10.Text : 排班明細.Show()
  1185. End Sub
  1186. Private Sub B11_tb_Click(sender As Object, e As EventArgs) Handles B11_tb.Click
  1187. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb11.Text : 排班明細.Show()
  1188. End Sub
  1189. Private Sub B12_tb_Click(sender As Object, e As EventArgs) Handles B12_tb.Click
  1190. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb12.Text : 排班明細.Show()
  1191. End Sub
  1192. Private Sub B13_tb_Click(sender As Object, e As EventArgs) Handles B13_tb.Click
  1193. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb13.Text : 排班明細.Show()
  1194. End Sub
  1195. Private Sub B14_tb_Click(sender As Object, e As EventArgs) Handles B14_tb.Click
  1196. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb14.Text : 排班明細.Show()
  1197. End Sub
  1198. Private Sub B15_tb_Click(sender As Object, e As EventArgs) Handles B15_tb.Click
  1199. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb15.Text : 排班明細.Show()
  1200. End Sub
  1201. Private Sub B16_tb_Click(sender As Object, e As EventArgs) Handles B16_tb.Click
  1202. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb16.Text : 排班明細.Show()
  1203. End Sub
  1204. Private Sub B17_tb_Click(sender As Object, e As EventArgs) Handles B17_tb.Click
  1205. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb17.Text : 排班明細.Show()
  1206. End Sub
  1207. Private Sub B18_tb_Click(sender As Object, e As EventArgs) Handles B18_tb.Click
  1208. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb18.Text : 排班明細.Show()
  1209. End Sub
  1210. Private Sub B19_tb_Click(sender As Object, e As EventArgs) Handles B19_tb.Click
  1211. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb19.Text : 排班明細.Show()
  1212. End Sub
  1213. Private Sub B20_tb_Click(sender As Object, e As EventArgs) Handles B20_tb.Click
  1214. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb20.Text : 排班明細.Show()
  1215. End Sub
  1216. Private Sub B21_tb_Click(sender As Object, e As EventArgs) Handles B21_tb.Click
  1217. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb21.Text : 排班明細.Show()
  1218. End Sub
  1219. Private Sub B22_tb_Click(sender As Object, e As EventArgs) Handles B22_tb.Click
  1220. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb22.Text : 排班明細.Show()
  1221. End Sub
  1222. Private Sub B23_tb_Click(sender As Object, e As EventArgs) Handles B23_tb.Click
  1223. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb23.Text : 排班明細.Show()
  1224. End Sub
  1225. Private Sub B24_tb_Click(sender As Object, e As EventArgs) Handles B24_tb.Click
  1226. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb24.Text : 排班明細.Show()
  1227. End Sub
  1228. Private Sub B25_tb_Click(sender As Object, e As EventArgs) Handles B25_tb.Click
  1229. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb25.Text : 排班明細.Show()
  1230. End Sub
  1231. Private Sub B26_tb_Click(sender As Object, e As EventArgs) Handles B26_tb.Click
  1232. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb26.Text : 排班明細.Show()
  1233. End Sub
  1234. Private Sub B27_tb_Click(sender As Object, e As EventArgs) Handles B27_tb.Click
  1235. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb27.Text : 排班明細.Show()
  1236. End Sub
  1237. Private Sub B28_tb_Click(sender As Object, e As EventArgs) Handles B28_tb.Click
  1238. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb28.Text : 排班明細.Show()
  1239. End Sub
  1240. Private Sub B29_tb_Click(sender As Object, e As EventArgs) Handles B29_tb.Click
  1241. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb29.Text : 排班明細.Show()
  1242. End Sub
  1243. Private Sub B30_tb_Click(sender As Object, e As EventArgs) Handles B30_tb.Click
  1244. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb30.Text : 排班明細.Show()
  1245. End Sub
  1246. Private Sub B31_tb_Click(sender As Object, e As EventArgs) Handles B31_tb.Click
  1247. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb31.Text : 排班明細.Show()
  1248. End Sub
  1249. Private Sub B32_tb_Click(sender As Object, e As EventArgs) Handles B32_tb.Click
  1250. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb32.Text : 排班明細.Show()
  1251. End Sub
  1252. Private Sub B33_tb_Click(sender As Object, e As EventArgs) Handles B33_tb.Click
  1253. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb33.Text : 排班明細.Show()
  1254. End Sub
  1255. Private Sub B34_tb_Click(sender As Object, e As EventArgs) Handles B34_tb.Click
  1256. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb34.Text : 排班明細.Show()
  1257. End Sub
  1258. Private Sub B35_tb_Click(sender As Object, e As EventArgs) Handles B35_tb.Click
  1259. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb35.Text : 排班明細.Show()
  1260. End Sub
  1261. Private Sub B36_tb_Click(sender As Object, e As EventArgs) Handles B36_tb.Click
  1262. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb36.Text : 排班明細.Show()
  1263. End Sub
  1264. Private Sub B37_tb_Click(sender As Object, e As EventArgs) Handles B37_tb.Click
  1265. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb37.Text : 排班明細.Show()
  1266. End Sub
  1267. Private Sub B38_tb_Click(sender As Object, e As EventArgs) Handles B38_tb.Click
  1268. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb38.Text : 排班明細.Show()
  1269. End Sub
  1270. Private Sub B39_tb_Click(sender As Object, e As EventArgs) Handles B39_tb.Click
  1271. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb39.Text : 排班明細.Show()
  1272. End Sub
  1273. Private Sub B40_tb_Click(sender As Object, e As EventArgs) Handles B40_tb.Click
  1274. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb40.Text : 排班明細.Show()
  1275. End Sub
  1276. Private Sub B41_tb_Click(sender As Object, e As EventArgs) Handles B41_tb.Click
  1277. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb41.Text : 排班明細.Show()
  1278. End Sub
  1279. Private Sub B42_tb_Click(sender As Object, e As EventArgs) Handles B42_tb.Click
  1280. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb42.Text : 排班明細.Show()
  1281. End Sub
  1282. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  1283. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb1.Text : 排班明細_參考.Show()
  1284. End Sub
  1285. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  1286. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb2.Text : 排班明細_參考.Show()
  1287. End Sub
  1288. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  1289. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb3.Text : 排班明細_參考.Show()
  1290. End Sub
  1291. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  1292. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb4.Text : 排班明細_參考.Show()
  1293. End Sub
  1294. Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  1295. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb5.Text : 排班明細_參考.Show()
  1296. End Sub
  1297. Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  1298. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb6.Text : 排班明細_參考.Show()
  1299. End Sub
  1300. Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
  1301. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb7.Text : 排班明細_參考.Show()
  1302. End Sub
  1303. Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
  1304. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb8.Text : 排班明細_參考.Show()
  1305. End Sub
  1306. Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
  1307. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb9.Text : 排班明細_參考.Show()
  1308. End Sub
  1309. Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
  1310. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb10.Text : 排班明細_參考.Show()
  1311. End Sub
  1312. Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
  1313. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb11.Text : 排班明細_參考.Show()
  1314. End Sub
  1315. Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
  1316. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb12.Text : 排班明細_參考.Show()
  1317. End Sub
  1318. Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
  1319. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb13.Text : 排班明細_參考.Show()
  1320. End Sub
  1321. Private Sub Button14_Click(sender As Object, e As EventArgs) Handles Button14.Click
  1322. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb14.Text : 排班明細_參考.Show()
  1323. End Sub
  1324. Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
  1325. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb15.Text : 排班明細_參考.Show()
  1326. End Sub
  1327. Private Sub Button16_Click(sender As Object, e As EventArgs) Handles Button16.Click
  1328. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb16.Text : 排班明細_參考.Show()
  1329. End Sub
  1330. Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
  1331. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb17.Text : 排班明細_參考.Show()
  1332. End Sub
  1333. Private Sub Button18_Click(sender As Object, e As EventArgs) Handles Button18.Click
  1334. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb18.Text : 排班明細_參考.Show()
  1335. End Sub
  1336. Private Sub Button19_Click(sender As Object, e As EventArgs) Handles Button19.Click
  1337. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb19.Text : 排班明細_參考.Show()
  1338. End Sub
  1339. Private Sub Button20_Click(sender As Object, e As EventArgs) Handles Button20.Click
  1340. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb20.Text : 排班明細_參考.Show()
  1341. End Sub
  1342. Private Sub Button21_Click(sender As Object, e As EventArgs) Handles Button21.Click
  1343. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb21.Text : 排班明細_參考.Show()
  1344. End Sub
  1345. Private Sub Button22_Click(sender As Object, e As EventArgs) Handles Button22.Click
  1346. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb22.Text : 排班明細_參考.Show()
  1347. End Sub
  1348. Private Sub Button23_Click(sender As Object, e As EventArgs) Handles Button23.Click
  1349. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb23.Text : 排班明細_參考.Show()
  1350. End Sub
  1351. Private Sub Button24_Click(sender As Object, e As EventArgs) Handles Button24.Click
  1352. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb24.Text : 排班明細_參考.Show()
  1353. End Sub
  1354. Private Sub Button25_Click(sender As Object, e As EventArgs) Handles Button25.Click
  1355. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb25.Text : 排班明細_參考.Show()
  1356. End Sub
  1357. Private Sub Button26_Click(sender As Object, e As EventArgs) Handles Button26.Click
  1358. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb26.Text : 排班明細_參考.Show()
  1359. End Sub
  1360. Private Sub Button27_Click(sender As Object, e As EventArgs) Handles Button27.Click
  1361. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb27.Text : 排班明細_參考.Show()
  1362. End Sub
  1363. Private Sub Button28_Click(sender As Object, e As EventArgs) Handles Button28.Click
  1364. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb28.Text : 排班明細_參考.Show()
  1365. End Sub
  1366. Private Sub Button29_Click(sender As Object, e As EventArgs) Handles Button29.Click
  1367. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb29.Text : 排班明細_參考.Show()
  1368. End Sub
  1369. Private Sub Button30_Click(sender As Object, e As EventArgs) Handles Button30.Click
  1370. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb30.Text : 排班明細_參考.Show()
  1371. End Sub
  1372. Private Sub Button31_Click(sender As Object, e As EventArgs) Handles Button31.Click
  1373. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb31.Text : 排班明細_參考.Show()
  1374. End Sub
  1375. Private Sub Button32_Click(sender As Object, e As EventArgs) Handles Button32.Click
  1376. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb32.Text : 排班明細_參考.Show()
  1377. End Sub
  1378. Private Sub Button33_Click(sender As Object, e As EventArgs) Handles Button33.Click
  1379. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb33.Text : 排班明細_參考.Show()
  1380. End Sub
  1381. Private Sub Button34_Click(sender As Object, e As EventArgs) Handles Button34.Click
  1382. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb34.Text : 排班明細_參考.Show()
  1383. End Sub
  1384. Private Sub Button35_Click(sender As Object, e As EventArgs) Handles Button35.Click
  1385. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb35.Text : 排班明細_參考.Show()
  1386. End Sub
  1387. Private Sub Button36_Click(sender As Object, e As EventArgs) Handles Button36.Click
  1388. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb36.Text : 排班明細_參考.Show()
  1389. End Sub
  1390. Private Sub Button37_Click(sender As Object, e As EventArgs) Handles Button37.Click
  1391. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb37.Text : 排班明細_參考.Show()
  1392. End Sub
  1393. Private Sub Button38_Click(sender As Object, e As EventArgs) Handles Button38.Click
  1394. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb38.Text : 排班明細_參考.Show()
  1395. End Sub
  1396. Private Sub Button39_Click(sender As Object, e As EventArgs) Handles Button39.Click
  1397. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb39.Text : 排班明細_參考.Show()
  1398. End Sub
  1399. Private Sub Button40_Click(sender As Object, e As EventArgs) Handles Button40.Click
  1400. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb40.Text : 排班明細_參考.Show()
  1401. End Sub
  1402. Private Sub Button41_Click(sender As Object, e As EventArgs) Handles Button41.Click
  1403. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb41.Text : 排班明細_參考.Show()
  1404. End Sub
  1405. Private Sub Button42_Click(sender As Object, e As EventArgs) Handles Button42.Click
  1406. PA = 年份_cb.Text : PA1 = 月份_cb.Text : PA2 = 日期_lb42.Text : 排班明細_參考.Show()
  1407. End Sub
  1408. Private Sub 列印_bt_Click(sender As Object, e As EventArgs) Handles 列印_bt.Click
  1409. 排班資料列印選擇.ShowDialog()
  1410. xlApp = CType(CreateObject("Excel.Application"), Application)
  1411. xlBook = xlApp.Workbooks.Add
  1412. xlApp.DisplayAlerts = True
  1413. xlApp.Visible = True
  1414. xlApp.Application.WindowState = xlMaximized
  1415. If PA = "統計" Then
  1416. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select
  1417. xlApp.Sheets(1).Name = "排班資料統計" : xlBook.Activate() : xlSheet.Activate()
  1418. xlSheet.Cells(1, 1) = "黃柏翰皮膚科診所-排班資料統計" : xlSheet.Cells(2, 1) = CInt(年份_cb.Text) - 1911 & "年" & 月份_cb.Text & "月 - 全月"
  1419. xlSheet.Cells(3, 1) = "項" : xlSheet.Cells(3, 2) = "姓名" : xlSheet.Cells(3, 3) = "天數" : xlSheet.Cells(3, 4) = "本月應上時數"
  1420. xlSheet.Cells(3, 5) = "已排班時數" : xlSheet.Cells(3, 6) = "未排班時數" : xlSheet.Cells(3, 7) = "假日出勤"
  1421. For i As Integer = 0 To 人員彙總_dgv.Rows.Count - 1
  1422. xlSheet.Cells(4 + i, 1) = i + 1 : xlSheet.Cells(4 + i, 2) = 人員彙總_dgv("姓名", i).Value.ToString
  1423. xlSheet.Cells(4 + i, 3) = 人員彙總_dgv("天數", i).Value.ToString
  1424. xlSheet.Cells(4 + i, 4) = 人員彙總_dgv("本月應上時數", i).Value.ToString
  1425. xlSheet.Cells(4 + i, 5) = 人員彙總_dgv("已排班時數", i).Value.ToString
  1426. xlSheet.Cells(4 + i, 6) = 人員彙總_dgv("未排班時數", i).Value.ToString
  1427. xlSheet.Cells(4 + i, 7) = 人員彙總_dgv("假日出勤", i).Value.ToString
  1428. Next : 位置1 = 4 + 人員彙總_dgv.Rows.Count - 1 : AA(xlApp, xlSheet)
  1429. xlSheet.PageSetup.PrintArea = "" : xlApp.Cells.Select() : xlSheet.Range("B1").Select() : xlApp.Application.WindowState = xlMinimized : MsgBox("排班資料統計列印完成!!")
  1430. Else
  1431. xlSheet = NewMethod(xlBook) : xlApp.Sheets(1).Select
  1432. xlApp.Sheets(1).Name = "排班月曆" : xlBook.Activate() : xlSheet.Activate()
  1433. xlSheet.Cells(1, 1) = "黃柏翰皮膚科診所-排班月曆" : xlSheet.Cells(2, 1) = CInt(年份_cb.Text) - 1911 & "年" & 月份_cb.Text & "月 - 全月"
  1434. xlSheet.Cells(3, 1) = "星期日" : xlSheet.Cells(3, 3) = "星期一" : xlSheet.Cells(3, 5) = "星期二" : xlSheet.Cells(3, 7) = "星期三"
  1435. xlSheet.Cells(3, 9) = "星期四" : xlSheet.Cells(3, 11) = "星期五" : xlSheet.Cells(3, 13) = "星期六" : 位置 = 0
  1436. '-----第一排-----------
  1437. If Label1.Text <> "XX" And CInt(日期_lb1.Text) > 0 Then : xlSheet.Cells(4, 1) = 日期_lb1.Text : xlSheet.Cells(4, 2) = Label1.Text
  1438. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  1439. xlSheet.Cells(5 + i, 1) = Strings.Left(DataGridView1(0, i).Value.ToString, 5) : xlSheet.Cells(5 + i, 2) = DataGridView1(1, i).Value.ToString
  1440. Next
  1441. End If : 位置1 = DataGridView1.Rows.Count
  1442. If Label2.Text <> "XX" And CInt(日期_lb2.Text) > 0 Then : xlSheet.Cells(4, 3) = 日期_lb2.Text : xlSheet.Cells(4, 4) = Label2.Text
  1443. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  1444. xlSheet.Cells(5 + i, 3) = Strings.Left(DataGridView2(0, i).Value.ToString, 5) : xlSheet.Cells(5 + i, 4) = DataGridView2(1, i).Value.ToString
  1445. Next
  1446. End If : If 位置1 < DataGridView2.Rows.Count Then : 位置1 = DataGridView2.Rows.Count : End If
  1447. If Label3.Text <> "XX" And CInt(日期_lb3.Text) > 0 Then : xlSheet.Cells(4, 5) = 日期_lb3.Text : xlSheet.Cells(4, 6) = Label3.Text
  1448. For i As Integer = 0 To DataGridView3.Rows.Count - 1
  1449. xlSheet.Cells(5 + i, 5) = Strings.Left(DataGridView3(0, i).Value.ToString, 5) : xlSheet.Cells(5 + i, 6) = DataGridView3(1, i).Value.ToString
  1450. Next
  1451. End If : If 位置1 < DataGridView3.Rows.Count Then : 位置1 = DataGridView3.Rows.Count : End If
  1452. If Label4.Text <> "XX" And CInt(日期_lb4.Text) > 0 Then : xlSheet.Cells(4, 7) = 日期_lb4.Text : xlSheet.Cells(4, 8) = Label4.Text
  1453. For i As Integer = 0 To DataGridView4.Rows.Count - 1
  1454. xlSheet.Cells(5 + i, 7) = Strings.Left(DataGridView4(0, i).Value.ToString, 5) : xlSheet.Cells(5 + i, 8) = DataGridView4(1, i).Value.ToString
  1455. Next
  1456. End If : If 位置1 < DataGridView4.Rows.Count Then : 位置1 = DataGridView4.Rows.Count : End If
  1457. If Label5.Text <> "XX" And CInt(日期_lb5.Text) > 0 Then : xlSheet.Cells(4, 9) = 日期_lb5.Text : xlSheet.Cells(4, 10) = Label5.Text
  1458. For i As Integer = 0 To DataGridView5.Rows.Count - 1
  1459. xlSheet.Cells(5 + i, 9) = Strings.Left(DataGridView5(0, i).Value.ToString, 5) : xlSheet.Cells(5 + i, 10) = DataGridView5(1, i).Value.ToString
  1460. Next
  1461. End If : If 位置1 < DataGridView5.Rows.Count Then : 位置1 = DataGridView5.Rows.Count : End If
  1462. If Label6.Text <> "XX" And CInt(日期_lb6.Text) > 0 Then : xlSheet.Cells(4, 11) = 日期_lb6.Text : xlSheet.Cells(4, 12) = Label6.Text
  1463. For i As Integer = 0 To DataGridView6.Rows.Count - 1
  1464. xlSheet.Cells(5 + i, 11) = Strings.Left(DataGridView6(0, i).Value.ToString, 5) : xlSheet.Cells(5 + i, 12) = DataGridView6(1, i).Value.ToString
  1465. Next
  1466. End If : If 位置1 < DataGridView6.Rows.Count Then : 位置1 = DataGridView6.Rows.Count : End If
  1467. If Label7.Text <> "XX" And CInt(日期_lb7.Text) > 0 Then : xlSheet.Cells(4, 13) = 日期_lb7.Text : xlSheet.Cells(4, 14) = Label7.Text
  1468. For i As Integer = 0 To DataGridView7.Rows.Count - 1
  1469. xlSheet.Cells(5 + i, 13) = Strings.Left(DataGridView7(0, i).Value.ToString, 5) : xlSheet.Cells(5 + i, 14) = DataGridView7(1, i).Value.ToString
  1470. Next
  1471. End If : If 位置1 < DataGridView7.Rows.Count Then : 位置1 = DataGridView7.Rows.Count : End If : 位置 += 位置1
  1472. '-----第二排-----------
  1473. If Label8.Text <> "XX" And CInt(日期_lb8.Text) > 0 Then : xlSheet.Cells(4 + 1 + 位置, 1) = 日期_lb8.Text : xlSheet.Cells(4 + 1 + 位置, 2) = Label8.Text
  1474. For i As Integer = 0 To DataGridView8.Rows.Count - 1
  1475. xlSheet.Cells(5 + 1 + 位置 + i, 1) = Strings.Left(DataGridView8(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 1 + 位置 + i, 2) = DataGridView8(1, i).Value.ToString
  1476. Next
  1477. End If : 位置2 = DataGridView8.Rows.Count
  1478. If Label9.Text <> "XX" And CInt(日期_lb9.Text) > 0 Then : xlSheet.Cells(4 + 1 + 位置, 3) = 日期_lb9.Text : xlSheet.Cells(4 + 1 + 位置, 4) = Label9.Text
  1479. For i As Integer = 0 To DataGridView9.Rows.Count - 1
  1480. xlSheet.Cells(5 + 1 + 位置 + i, 3) = Strings.Left(DataGridView9(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 1 + 位置 + i, 4) = DataGridView9(1, i).Value.ToString
  1481. Next
  1482. End If : If 位置2 < DataGridView9.Rows.Count Then : 位置2 = DataGridView9.Rows.Count : End If
  1483. If Label10.Text <> "XX" And CInt(日期_lb10.Text) > 0 Then : xlSheet.Cells(4 + 1 + 位置, 5) = 日期_lb10.Text : xlSheet.Cells(4 + 1 + 位置, 6) = Label10.Text
  1484. For i As Integer = 0 To DataGridView10.Rows.Count - 1
  1485. xlSheet.Cells(5 + 1 + 位置 + i, 5) = Strings.Left(DataGridView10(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 1 + 位置 + i, 6) = DataGridView10(1, i).Value.ToString
  1486. Next
  1487. End If : If 位置2 < DataGridView10.Rows.Count Then : 位置2 = DataGridView10.Rows.Count : End If
  1488. If Label11.Text <> "XX" And CInt(日期_lb11.Text) > 0 Then : xlSheet.Cells(4 + 1 + 位置, 7) = 日期_lb11.Text : xlSheet.Cells(4 + 1 + 位置, 8) = Label11.Text
  1489. For i As Integer = 0 To DataGridView11.Rows.Count - 1
  1490. xlSheet.Cells(5 + 1 + 位置 + i, 7) = Strings.Left(DataGridView11(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 1 + 位置 + i, 8) = DataGridView11(1, i).Value.ToString
  1491. Next
  1492. End If : If 位置2 < DataGridView11.Rows.Count Then : 位置2 = DataGridView11.Rows.Count : End If
  1493. If Label12.Text <> "XX" And CInt(日期_lb12.Text) > 0 Then : xlSheet.Cells(4 + 1 + 位置, 9) = 日期_lb12.Text : xlSheet.Cells(4 + 1 + 位置, 10) = Label12.Text
  1494. For i As Integer = 0 To DataGridView12.Rows.Count - 1
  1495. xlSheet.Cells(5 + 1 + 位置 + i, 9) = Strings.Left(DataGridView12(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 1 + 位置 + i, 10) = DataGridView12(1, i).Value.ToString
  1496. Next
  1497. End If : If 位置2 < DataGridView12.Rows.Count Then : 位置2 = DataGridView12.Rows.Count : End If
  1498. If Label13.Text <> "XX" And CInt(日期_lb13.Text) > 0 Then : xlSheet.Cells(4 + 1 + 位置, 11) = 日期_lb13.Text : xlSheet.Cells(4 + 1 + 位置, 12) = Label13.Text
  1499. For i As Integer = 0 To DataGridView13.Rows.Count - 1
  1500. xlSheet.Cells(5 + 1 + 位置 + i, 11) = Strings.Left(DataGridView13(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 1 + 位置 + i, 12) = DataGridView13(1, i).Value.ToString
  1501. Next
  1502. End If : If 位置2 < DataGridView13.Rows.Count Then : 位置2 = DataGridView13.Rows.Count : End If
  1503. If Label14.Text <> "XX" And CInt(日期_lb14.Text) > 0 Then : xlSheet.Cells(4 + 1 + 位置, 13) = 日期_lb14.Text : xlSheet.Cells(4 + 1 + 位置, 14) = Label14.Text
  1504. For i As Integer = 0 To DataGridView14.Rows.Count - 1
  1505. xlSheet.Cells(5 + 1 + 位置 + i, 13) = Strings.Left(DataGridView14(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 1 + 位置 + i, 14) = DataGridView14(1, i).Value.ToString
  1506. Next
  1507. End If : If 位置2 < DataGridView14.Rows.Count Then : 位置2 = DataGridView14.Rows.Count : End If : 位置 += 位置2
  1508. '-----第三排-----------
  1509. If Label15.Text <> "XX" And CInt(日期_lb15.Text) > 0 Then : xlSheet.Cells(4 + 2 + 位置, 1) = 日期_lb15.Text : xlSheet.Cells(4 + 2 + 位置, 2) = Label15.Text
  1510. For i As Integer = 0 To DataGridView15.Rows.Count - 1
  1511. xlSheet.Cells(5 + 2 + 位置 + i, 1) = Strings.Left(DataGridView15(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 2 + 位置 + i, 2) = DataGridView15(1, i).Value.ToString
  1512. Next
  1513. End If : 位置3 = DataGridView15.Rows.Count
  1514. If Label16.Text <> "XX" And CInt(日期_lb16.Text) > 0 Then : xlSheet.Cells(4 + 2 + 位置, 3) = 日期_lb16.Text : xlSheet.Cells(4 + 2 + 位置, 4) = Label16.Text
  1515. For i As Integer = 0 To DataGridView16.Rows.Count - 1
  1516. xlSheet.Cells(5 + 2 + 位置 + i, 3) = Strings.Left(DataGridView16(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 2 + 位置 + i, 4) = DataGridView16(1, i).Value.ToString
  1517. Next
  1518. End If : If 位置3 < DataGridView16.Rows.Count Then : 位置3 = DataGridView16.Rows.Count : End If
  1519. If Label17.Text <> "XX" And CInt(日期_lb17.Text) > 0 Then : xlSheet.Cells(4 + 2 + 位置, 5) = 日期_lb17.Text : xlSheet.Cells(4 + 2 + 位置, 6) = Label17.Text
  1520. For i As Integer = 0 To DataGridView17.Rows.Count - 1
  1521. xlSheet.Cells(5 + 2 + 位置 + i, 5) = Strings.Left(DataGridView17(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 2 + 位置 + i, 6) = DataGridView17(1, i).Value.ToString
  1522. Next
  1523. End If : If 位置3 < DataGridView17.Rows.Count Then : 位置3 = DataGridView17.Rows.Count : End If
  1524. If Label18.Text <> "XX" And CInt(日期_lb18.Text) > 0 Then : xlSheet.Cells(4 + 2 + 位置, 7) = 日期_lb18.Text : xlSheet.Cells(4 + 2 + 位置, 8) = Label18.Text
  1525. For i As Integer = 0 To DataGridView18.Rows.Count - 1
  1526. xlSheet.Cells(5 + 2 + 位置 + i, 7) = Strings.Left(DataGridView18(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 2 + 位置 + i, 8) = DataGridView18(1, i).Value.ToString
  1527. Next
  1528. End If : If 位置3 < DataGridView18.Rows.Count Then : 位置3 = DataGridView18.Rows.Count : End If
  1529. If Label19.Text <> "XX" And CInt(日期_lb19.Text) > 0 Then : xlSheet.Cells(4 + 2 + 位置, 9) = 日期_lb19.Text : xlSheet.Cells(4 + 2 + 位置, 10) = Label19.Text
  1530. For i As Integer = 0 To DataGridView19.Rows.Count - 1
  1531. xlSheet.Cells(5 + 2 + 位置 + i, 9) = Strings.Left(DataGridView19(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 2 + 位置 + i, 10) = DataGridView19(1, i).Value.ToString
  1532. Next
  1533. End If : If 位置3 < DataGridView19.Rows.Count Then : 位置3 = DataGridView19.Rows.Count : End If
  1534. If Label20.Text <> "XX" And CInt(日期_lb20.Text) > 0 Then : xlSheet.Cells(4 + 2 + 位置, 11) = 日期_lb20.Text : xlSheet.Cells(4 + 2 + 位置, 12) = Label20.Text
  1535. For i As Integer = 0 To DataGridView20.Rows.Count - 1
  1536. xlSheet.Cells(5 + 2 + 位置 + i, 11) = Strings.Left(DataGridView20(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 2 + 位置 + i, 12) = DataGridView20(1, i).Value.ToString
  1537. Next
  1538. End If : If 位置3 < DataGridView20.Rows.Count Then : 位置3 = DataGridView20.Rows.Count : End If
  1539. If Label21.Text <> "XX" And CInt(日期_lb21.Text) > 0 Then : xlSheet.Cells(4 + 2 + 位置, 13) = 日期_lb21.Text : xlSheet.Cells(4 + 2 + 位置, 14) = Label21.Text
  1540. For i As Integer = 0 To DataGridView21.Rows.Count - 1
  1541. xlSheet.Cells(5 + 2 + 位置 + i, 13) = Strings.Left(DataGridView21(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 2 + 位置 + i, 14) = DataGridView21(1, i).Value.ToString
  1542. Next
  1543. End If : If 位置3 < DataGridView21.Rows.Count Then : 位置3 = DataGridView21.Rows.Count : End If : 位置 += 位置3
  1544. '-----第四排-----------
  1545. If Label22.Text <> "XX" And CInt(日期_lb22.Text) > 0 Then : xlSheet.Cells(4 + 3 + 位置, 1) = 日期_lb22.Text : xlSheet.Cells(4 + 3 + 位置, 2) = Label22.Text
  1546. For i As Integer = 0 To DataGridView22.Rows.Count - 1
  1547. xlSheet.Cells(5 + 3 + 位置 + i, 1) = Strings.Left(DataGridView22(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 3 + 位置 + i, 2) = DataGridView22(1, i).Value.ToString
  1548. Next
  1549. End If : 位置4 = DataGridView22.Rows.Count
  1550. If Label23.Text <> "XX" And CInt(日期_lb23.Text) > 0 Then : xlSheet.Cells(4 + 3 + 位置, 3) = 日期_lb23.Text : xlSheet.Cells(4 + 3 + 位置, 4) = Label23.Text
  1551. For i As Integer = 0 To DataGridView23.Rows.Count - 1
  1552. xlSheet.Cells(5 + 3 + 位置 + i, 3) = Strings.Left(DataGridView23(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 3 + 位置 + i, 4) = DataGridView23(1, i).Value.ToString
  1553. Next
  1554. End If : If 位置4 < DataGridView23.Rows.Count Then : 位置4 = DataGridView23.Rows.Count : End If
  1555. If Label24.Text <> "XX" And CInt(日期_lb24.Text) > 0 Then : xlSheet.Cells(4 + 3 + 位置, 5) = 日期_lb24.Text : xlSheet.Cells(4 + 3 + 位置, 6) = Label24.Text
  1556. For i As Integer = 0 To DataGridView24.Rows.Count - 1
  1557. xlSheet.Cells(5 + 3 + 位置 + i, 5) = Strings.Left(DataGridView24(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 3 + 位置 + i, 6) = DataGridView24(1, i).Value.ToString
  1558. Next
  1559. End If : If 位置4 < DataGridView24.Rows.Count Then : 位置4 = DataGridView24.Rows.Count : End If
  1560. If Label25.Text <> "XX" And CInt(日期_lb25.Text) > 0 Then : xlSheet.Cells(4 + 3 + 位置, 7) = 日期_lb25.Text : xlSheet.Cells(4 + 3 + 位置, 8) = Label25.Text
  1561. For i As Integer = 0 To DataGridView25.Rows.Count - 1
  1562. xlSheet.Cells(5 + 3 + 位置 + i, 7) = Strings.Left(DataGridView25(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 3 + 位置 + i, 8) = DataGridView25(1, i).Value.ToString
  1563. Next
  1564. End If : If 位置4 < DataGridView25.Rows.Count Then : 位置4 = DataGridView25.Rows.Count : End If
  1565. If Label26.Text <> "XX" And CInt(日期_lb26.Text) > 0 Then : xlSheet.Cells(4 + 3 + 位置, 9) = 日期_lb26.Text : xlSheet.Cells(4 + 3 + 位置, 10) = Label26.Text
  1566. For i As Integer = 0 To DataGridView26.Rows.Count - 1
  1567. xlSheet.Cells(5 + 3 + 位置 + i, 9) = Strings.Left(DataGridView26(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 3 + 位置 + i, 10) = DataGridView26(1, i).Value.ToString
  1568. Next
  1569. End If : If 位置4 < DataGridView26.Rows.Count Then : 位置4 = DataGridView26.Rows.Count : End If
  1570. If Label27.Text <> "XX" And CInt(日期_lb27.Text) > 0 Then : xlSheet.Cells(4 + 3 + 位置, 11) = 日期_lb27.Text : xlSheet.Cells(4 + 3 + 位置, 12) = Label27.Text
  1571. For i As Integer = 0 To DataGridView27.Rows.Count - 1
  1572. xlSheet.Cells(5 + 3 + 位置 + i, 11) = Strings.Left(DataGridView27(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 3 + 位置 + i, 12) = DataGridView27(1, i).Value.ToString
  1573. Next
  1574. End If : If 位置4 < DataGridView27.Rows.Count Then : 位置4 = DataGridView27.Rows.Count : End If
  1575. If Label28.Text <> "XX" And CInt(日期_lb28.Text) > 0 Then : xlSheet.Cells(4 + 3 + 位置, 13) = 日期_lb28.Text : xlSheet.Cells(4 + 3 + 位置, 14) = Label28.Text
  1576. For i As Integer = 0 To DataGridView28.Rows.Count - 1
  1577. xlSheet.Cells(5 + 3 + 位置 + i, 13) = Strings.Left(DataGridView28(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 3 + 位置 + i, 14) = DataGridView28(1, i).Value.ToString
  1578. Next
  1579. End If : If 位置4 < DataGridView28.Rows.Count Then : 位置4 = DataGridView28.Rows.Count : End If : 位置 += 位置4
  1580. '-----第五排-----------
  1581. If Label29.Text <> "XX" And CInt(日期_lb29.Text) > 0 Then : xlSheet.Cells(4 + 4 + 位置, 1) = 日期_lb29.Text : xlSheet.Cells(4 + 4 + 位置, 2) = Label29.Text
  1582. For i As Integer = 0 To DataGridView29.Rows.Count - 1
  1583. xlSheet.Cells(5 + 4 + 位置 + i, 1) = Strings.Left(DataGridView29(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 4 + 位置 + i, 2) = DataGridView29(1, i).Value.ToString
  1584. Next
  1585. End If : 位置5 = DataGridView29.Rows.Count
  1586. If Label30.Text <> "XX" And CInt(日期_lb30.Text) > 0 Then : xlSheet.Cells(4 + 4 + 位置, 3) = 日期_lb30.Text : xlSheet.Cells(4 + 4 + 位置, 4) = Label30.Text
  1587. For i As Integer = 0 To DataGridView30.Rows.Count - 1
  1588. xlSheet.Cells(5 + 4 + 位置 + i, 3) = Strings.Left(DataGridView30(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 4 + 位置 + i, 4) = DataGridView30(1, i).Value.ToString
  1589. Next
  1590. End If : If 位置5 < DataGridView30.Rows.Count Then : 位置5 = DataGridView30.Rows.Count : End If
  1591. If Label31.Text <> "XX" And CInt(日期_lb31.Text) > 0 Then : xlSheet.Cells(4 + 4 + 位置, 5) = 日期_lb31.Text : xlSheet.Cells(4 + 4 + 位置, 6) = Label31.Text
  1592. For i As Integer = 0 To DataGridView31.Rows.Count - 1
  1593. xlSheet.Cells(5 + 4 + 位置 + i, 5) = Strings.Left(DataGridView31(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 4 + 位置 + i, 6) = DataGridView31(1, i).Value.ToString
  1594. Next
  1595. End If : If 位置5 < DataGridView31.Rows.Count Then : 位置5 = DataGridView31.Rows.Count : End If
  1596. If Label32.Text <> "XX" And CInt(日期_lb32.Text) > 0 Then : xlSheet.Cells(4 + 4 + 位置, 7) = 日期_lb32.Text : xlSheet.Cells(4 + 4 + 位置, 8) = Label32.Text
  1597. For i As Integer = 0 To DataGridView32.Rows.Count - 1
  1598. xlSheet.Cells(5 + 4 + 位置 + i, 7) = Strings.Left(DataGridView32(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 4 + 位置 + i, 8) = DataGridView32(1, i).Value.ToString
  1599. Next
  1600. End If : If 位置5 < DataGridView32.Rows.Count Then : 位置5 = DataGridView32.Rows.Count : End If
  1601. If Label33.Text <> "XX" And CInt(日期_lb33.Text) > 0 Then : xlSheet.Cells(4 + 4 + 位置, 9) = 日期_lb33.Text : xlSheet.Cells(4 + 4 + 位置, 10) = Label33.Text
  1602. For i As Integer = 0 To DataGridView33.Rows.Count - 1
  1603. xlSheet.Cells(5 + 4 + 位置 + i, 9) = Strings.Left(DataGridView33(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 4 + 位置 + i, 10) = DataGridView33(1, i).Value.ToString
  1604. Next
  1605. End If : If 位置5 < DataGridView33.Rows.Count Then : 位置5 = DataGridView33.Rows.Count : End If
  1606. If Label34.Text <> "XX" And CInt(日期_lb34.Text) > 0 Then : xlSheet.Cells(4 + 4 + 位置, 11) = 日期_lb34.Text : xlSheet.Cells(4 + 4 + 位置, 12) = Label34.Text
  1607. For i As Integer = 0 To DataGridView34.Rows.Count - 1
  1608. xlSheet.Cells(5 + 4 + 位置 + i, 11) = Strings.Left(DataGridView34(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 4 + 位置 + i, 12) = DataGridView34(1, i).Value.ToString
  1609. Next
  1610. End If : If 位置5 < DataGridView34.Rows.Count Then : 位置5 = DataGridView34.Rows.Count : End If
  1611. If Label35.Text <> "XX" And CInt(日期_lb35.Text) > 0 Then : xlSheet.Cells(4 + 4 + 位置, 13) = 日期_lb35.Text : xlSheet.Cells(4 + 4 + 位置, 14) = Label35.Text
  1612. For i As Integer = 0 To DataGridView35.Rows.Count - 1
  1613. xlSheet.Cells(5 + 4 + 位置 + i, 13) = Strings.Left(DataGridView35(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 4 + 位置 + i, 14) = DataGridView35(1, i).Value.ToString
  1614. Next
  1615. End If : If 位置5 < DataGridView35.Rows.Count Then : 位置5 = DataGridView35.Rows.Count : End If : 位置 += 位置5
  1616. '-----第六排-----------
  1617. If Label36.Text <> "XX" And CInt(日期_lb36.Text) > 0 Then : xlSheet.Cells(4 + 5 + 位置, 1) = 日期_lb36.Text : xlSheet.Cells(4 + 5 + 位置, 2) = Label36.Text
  1618. For i As Integer = 0 To DataGridView36.Rows.Count - 1
  1619. xlSheet.Cells(5 + 5 + 位置 + i, 1) = Strings.Left(DataGridView36(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 5 + 位置 + i, 2) = DataGridView36(1, i).Value.ToString
  1620. Next
  1621. End If : 位置6 = DataGridView36.Rows.Count
  1622. If Label37.Text <> "XX" And CInt(日期_lb37.Text) > 0 Then : xlSheet.Cells(4 + 5 + 位置, 3) = 日期_lb37.Text : xlSheet.Cells(4 + 5 + 位置, 4) = Label37.Text
  1623. For i As Integer = 0 To DataGridView37.Rows.Count - 1
  1624. xlSheet.Cells(5 + 5 + 位置 + i, 3) = Strings.Left(DataGridView37(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 5 + 位置 + i, 4) = DataGridView37(1, i).Value.ToString
  1625. Next
  1626. End If : If 位置6 < DataGridView37.Rows.Count Then : 位置6 = DataGridView37.Rows.Count : End If
  1627. If Label38.Text <> "XX" And CInt(日期_lb38.Text) > 0 Then : xlSheet.Cells(4 + 5 + 位置, 5) = 日期_lb38.Text : xlSheet.Cells(4 + 5 + 位置, 6) = Label38.Text
  1628. For i As Integer = 0 To DataGridView38.Rows.Count - 1
  1629. xlSheet.Cells(5 + 5 + 位置 + i, 5) = Strings.Left(DataGridView38(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 5 + 位置 + i, 6) = DataGridView38(1, i).Value.ToString
  1630. Next
  1631. End If : If 位置6 < DataGridView38.Rows.Count Then : 位置6 = DataGridView38.Rows.Count : End If
  1632. If Label39.Text <> "XX" And CInt(日期_lb39.Text) > 0 Then : xlSheet.Cells(4 + 5 + 位置, 7) = 日期_lb39.Text : xlSheet.Cells(4 + 5 + 位置, 8) = Label39.Text
  1633. For i As Integer = 0 To DataGridView39.Rows.Count - 1
  1634. xlSheet.Cells(5 + 5 + 位置 + i, 7) = Strings.Left(DataGridView39(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 5 + 位置 + i, 8) = DataGridView39(1, i).Value.ToString
  1635. Next
  1636. End If : If 位置6 < DataGridView39.Rows.Count Then : 位置6 = DataGridView39.Rows.Count : End If
  1637. If Label40.Text <> "XX" And CInt(日期_lb40.Text) > 0 Then : xlSheet.Cells(4 + 5 + 位置, 9) = 日期_lb40.Text : xlSheet.Cells(4 + 5 + 位置, 10) = Label40.Text
  1638. For i As Integer = 0 To DataGridView40.Rows.Count - 1
  1639. xlSheet.Cells(5 + 5 + 位置 + i, 9) = Strings.Left(DataGridView40(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 5 + 位置 + i, 10) = DataGridView40(1, i).Value.ToString
  1640. Next
  1641. End If : If 位置6 < DataGridView40.Rows.Count Then : 位置6 = DataGridView40.Rows.Count : End If
  1642. If Label41.Text <> "XX" And CInt(日期_lb41.Text) > 0 Then : xlSheet.Cells(4 + 5 + 位置, 11) = 日期_lb41.Text : xlSheet.Cells(4 + 5 + 位置, 12) = Label41.Text
  1643. For i As Integer = 0 To DataGridView41.Rows.Count - 1
  1644. xlSheet.Cells(5 + 5 + 位置 + i, 11) = Strings.Left(DataGridView41(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 5 + 位置 + i, 12) = DataGridView41(1, i).Value.ToString
  1645. Next
  1646. End If : If 位置6 < DataGridView41.Rows.Count Then : 位置6 = DataGridView41.Rows.Count : End If
  1647. If Label42.Text <> "XX" And CInt(日期_lb42.Text) > 0 Then : xlSheet.Cells(4 + 5 + 位置, 13) = 日期_lb42.Text : xlSheet.Cells(4 + 5 + 位置, 14) = Label42.Text
  1648. For i As Integer = 0 To DataGridView42.Rows.Count - 1
  1649. xlSheet.Cells(5 + 5 + 位置 + i, 13) = Strings.Left(DataGridView42(0, i).Value.ToString, 5) : xlSheet.Cells(5 + 5 + 位置 + i, 14) = DataGridView42(1, i).Value.ToString
  1650. Next
  1651. End If : If 位置6 < DataGridView42.Rows.Count Then : 位置6 = DataGridView42.Rows.Count : End If : 位置 += 位置6 : BB(xlApp, xlSheet)
  1652. xlSheet.PageSetup.PrintArea = "" : xlApp.Cells.Select() : xlSheet.Range("B1").Select() : xlApp.Application.WindowState = xlMinimized : MsgBox("排班月曆列印完成!!")
  1653. End If : PA = ""
  1654. End Sub
  1655. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  1656. Return CType(xlBook.Worksheets.Add, Worksheet)
  1657. End Function
  1658. Private Sub AA(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  1659. xlSheet.Cells.Select()
  1660. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 11 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1661. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1662. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 4
  1663. xlSheet.Range("A3:G" & 位置1).Select()
  1664. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1665. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1666. xlSheet.Range("C4:G" & 位置1).Select()
  1667. With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1668. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1669. myExcel.Selection.Style = "Comma"
  1670. myExcel.Selection.NumberFormatLocal = "_-* #,##0.0_-;-* #,##0.0_-;_-* ""-""??_-;_-@_-"
  1671. xlSheet.Range("C4:D" & 位置1).Select()
  1672. myExcel.Selection.NumberFormatLocal = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
  1673. xlSheet.Range("G4:G" & 位置1).Select()
  1674. myExcel.Selection.NumberFormatLocal = "_-* #,##0_-;-* #,##0_-;_-* ""-""??_-;_-@_-"
  1675. xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 35
  1676. With myExcel.Selection : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1677. .ReadingOrder = xlContext : .MergeCells = False : End With
  1678. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 6
  1679. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 6
  1680. xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 7
  1681. xlSheet.Columns("E:F").Select : myExcel.Selection.ColumnWidth = 8
  1682. xlSheet.Range("A3:G" & 位置1).Select()
  1683. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1684. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1685. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1686. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1687. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1688. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1689. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1690. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1691. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1692. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1693. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1694. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1695. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1696. xlSheet.Range("A3:G3").Select()
  1697. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1698. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1699. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1700. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1701. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1702. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1703. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1704. With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0.799981688894314
  1705. .PatternTintAndShade = 0 : End With
  1706. xlSheet.Range("A2:G2").Select()
  1707. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1708. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1709. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1710. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1711. xlSheet.Range("A1:G1").Select()
  1712. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 16 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1713. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1714. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1715. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1716. xlSheet.Range("I5").Select() : myExcel.ActiveWindow.DisplayGridlines = False
  1717. End Sub
  1718. Private Sub BB(ByVal myExcel As Microsoft.Office.Interop.Excel.Application, ByVal xlSheet As Microsoft.Office.Interop.Excel.Worksheet)
  1719. xlSheet.Cells.Select()
  1720. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 9 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1721. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1722. With myExcel.Selection : .HorizontalAlignment = xlLeft : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1723. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1724. xlSheet.Range("A:A,C:C,E:E,G:G,I:I,K:K,M:M").Select() : myExcel.Selection.ColumnWidth = 6 : myExcel.ActiveWindow.DisplayGridlines = False
  1725. xlSheet.Rows("3:3").Select
  1726. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1727. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1728. xlSheet.Rows("4:4").Select
  1729. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1730. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1731. xlSheet.Rows(4 + 1 + 位置1 & ":" & 4 + 1 + 位置1).Select
  1732. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1733. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1734. xlSheet.Rows(4 + 2 + 位置1 + 位置2 & ":" & 4 + 2 + 位置1 + 位置2).Select
  1735. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1736. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1737. xlSheet.Rows(4 + 3 + 位置1 + 位置2 + 位置3 & ":" & 4 + 3 + 位置1 + 位置2 + 位置3).Select
  1738. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1739. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1740. xlSheet.Rows(4 + 4 + 位置1 + 位置2 + 位置3 + 位置4 & ":" & 4 + 4 + 位置1 + 位置2 + 位置3 + 位置4).Select
  1741. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1742. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1743. xlSheet.Rows(4 + 5 + 位置1 + 位置2 + 位置3 + 位置4 + 位置5 & ":" & 4 + 5 + 位置1 + 位置2 + 位置3 + 位置4 + 位置5).Select
  1744. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1745. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1746. xlSheet.Range("B:B,D:D,F:F,H:H,J:J,L:L,N:N").Select() : myExcel.Selection.ColumnWidth = 24
  1747. xlSheet.Range("A3:B3").Select()
  1748. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1749. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1750. xlSheet.Range("C3:D3").Select()
  1751. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1752. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1753. xlSheet.Range("E3:F3").Select()
  1754. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1755. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1756. xlSheet.Range("G3:H3").Select()
  1757. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1758. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1759. xlSheet.Range("I3:J3").Select()
  1760. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1761. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1762. xlSheet.Range("K3:L3").Select()
  1763. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1764. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1765. xlSheet.Range("M3:N3").Select()
  1766. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1767. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1768. xlSheet.Rows("4:4").Select : myExcel.ActiveWindow.FreezePanes = True
  1769. Dim 第一, 第二 As String : 第一 = "" : 第二 = ""
  1770. For i As Integer = 1 To 7
  1771. If i = 1 Then : 第一 = "A" : 第二 = "B" : ElseIf i = 2 Then : 第一 = "C" : 第二 = "D" : ElseIf i = 3 Then : 第一 = "E" : 第二 = "F"
  1772. ElseIf i = 4 Then : 第一 = "G" : 第二 = "H" : ElseIf i = 5 Then : 第一 = "I" : 第二 = "J" : ElseIf i = 6 Then : 第一 = "K" : 第二 = "L"
  1773. ElseIf i = 7 Then : 第一 = "M" : 第二 = "N" : End If
  1774. xlSheet.Range(第一 & "4:" & 第二 & 4 + 位置1).Select()
  1775. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1776. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1777. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1778. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1779. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1780. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1781. xlSheet.Range(第一 & "4:" & 第二 & "4").Select()
  1782. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1783. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1784. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1785. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1786. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1787. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1788. Next
  1789. For i As Integer = 1 To 7
  1790. If i = 1 Then : 第一 = "A" : 第二 = "B" : ElseIf i = 2 Then : 第一 = "C" : 第二 = "D" : ElseIf i = 3 Then : 第一 = "E" : 第二 = "F"
  1791. ElseIf i = 4 Then : 第一 = "G" : 第二 = "H" : ElseIf i = 5 Then : 第一 = "I" : 第二 = "J" : ElseIf i = 6 Then : 第一 = "K" : 第二 = "L"
  1792. ElseIf i = 7 Then : 第一 = "M" : 第二 = "N" : End If
  1793. xlSheet.Range(第一 & 5 + 位置1 & ":" & 第二 & 5 + 位置1 + 位置2).Select()
  1794. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1795. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1796. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1797. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1798. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1799. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1800. xlSheet.Range(第一 & 5 + 位置1 & ":" & 第二 & 5 + 位置1).Select()
  1801. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1802. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1803. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1804. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1805. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1806. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1807. Next
  1808. For i As Integer = 1 To 7
  1809. If i = 1 Then : 第一 = "A" : 第二 = "B" : ElseIf i = 2 Then : 第一 = "C" : 第二 = "D" : ElseIf i = 3 Then : 第一 = "E" : 第二 = "F"
  1810. ElseIf i = 4 Then : 第一 = "G" : 第二 = "H" : ElseIf i = 5 Then : 第一 = "I" : 第二 = "J" : ElseIf i = 6 Then : 第一 = "K" : 第二 = "L"
  1811. ElseIf i = 7 Then : 第一 = "M" : 第二 = "N" : End If
  1812. xlSheet.Range(第一 & 5 + 1 + 位置1 + 位置2 & ":" & 第二 & 5 + 1 + 位置1 + 位置2 + 位置3).Select()
  1813. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1814. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1815. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1816. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1817. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1818. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1819. xlSheet.Range(第一 & 5 + 1 + 位置1 + 位置2 & ":" & 第二 & 5 + 1 + 位置1 + 位置2).Select()
  1820. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1821. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1822. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1823. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1824. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1825. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1826. Next
  1827. For i As Integer = 1 To 7
  1828. If i = 1 Then : 第一 = "A" : 第二 = "B" : ElseIf i = 2 Then : 第一 = "C" : 第二 = "D" : ElseIf i = 3 Then : 第一 = "E" : 第二 = "F"
  1829. ElseIf i = 4 Then : 第一 = "G" : 第二 = "H" : ElseIf i = 5 Then : 第一 = "I" : 第二 = "J" : ElseIf i = 6 Then : 第一 = "K" : 第二 = "L"
  1830. ElseIf i = 7 Then : 第一 = "M" : 第二 = "N" : End If
  1831. xlSheet.Range(第一 & 5 + 2 + 位置1 + 位置2 + 位置3 & ":" & 第二 & 5 + 2 + 位置1 + 位置2 + 位置3 + 位置4).Select()
  1832. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1833. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1834. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1835. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1836. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1837. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1838. xlSheet.Range(第一 & 5 + 2 + 位置1 + 位置2 + 位置3 & ":" & 第二 & 5 + 2 + 位置1 + 位置2 + 位置3).Select()
  1839. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1840. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1841. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1842. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1843. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1844. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1845. Next
  1846. If 位置5 > 0 Then
  1847. For i As Integer = 1 To 7
  1848. If i = 1 Then : 第一 = "A" : 第二 = "B" : ElseIf i = 2 Then : 第一 = "C" : 第二 = "D" : ElseIf i = 3 Then : 第一 = "E" : 第二 = "F"
  1849. ElseIf i = 4 Then : 第一 = "G" : 第二 = "H" : ElseIf i = 5 Then : 第一 = "I" : 第二 = "J" : ElseIf i = 6 Then : 第一 = "K" : 第二 = "L"
  1850. ElseIf i = 7 Then : 第一 = "M" : 第二 = "N" : End If
  1851. xlSheet.Range(第一 & 5 + 3 + 位置1 + 位置2 + 位置3 + 位置4 & ":" & 第二 & 5 + 3 + 位置1 + 位置2 + 位置3 + 位置4 + 位置5).Select()
  1852. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1853. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1854. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1855. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1856. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1857. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1858. xlSheet.Range(第一 & 5 + 3 + 位置1 + 位置2 + 位置3 + 位置4 & ":" & 第二 & 5 + 3 + 位置1 + 位置2 + 位置3 + 位置4).Select()
  1859. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1860. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1861. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1862. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1863. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1864. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1865. Next
  1866. End If
  1867. If 位置6 > 0 Then
  1868. For i As Integer = 1 To 7
  1869. If i = 1 Then : 第一 = "A" : 第二 = "B" : ElseIf i = 2 Then : 第一 = "C" : 第二 = "D" : ElseIf i = 3 Then : 第一 = "E" : 第二 = "F"
  1870. ElseIf i = 4 Then : 第一 = "G" : 第二 = "H" : ElseIf i = 5 Then : 第一 = "I" : 第二 = "J" : ElseIf i = 6 Then : 第一 = "K" : 第二 = "L"
  1871. ElseIf i = 7 Then : 第一 = "M" : 第二 = "N" : End If
  1872. xlSheet.Range(第一 & 5 + 4 + 位置1 + 位置2 + 位置3 + 位置4 + 位置5 & ":" & 第二 & 5 + 4 + 位置1 + 位置2 + 位置3 + 位置4 + 位置5 + 位置6).Select()
  1873. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1874. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1875. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1876. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1877. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1878. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1879. xlSheet.Range(第一 & 5 + 4 + 位置1 + 位置2 + 位置3 + 位置4 + 位置5 & ":" & 第二 & 5 + 4 + 位置1 + 位置2 + 位置3 + 位置4 + 位置5).Select()
  1880. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1881. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1882. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1883. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
  1884. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1885. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1886. Next
  1887. End If
  1888. xlSheet.Range("A3:B3").Select()
  1889. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1890. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1891. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1892. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1893. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1894. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1895. xlSheet.Range("C3:D3").Select()
  1896. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1897. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1898. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1899. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1900. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1901. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1902. xlSheet.Range("E3:F3").Select()
  1903. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1904. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1905. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1906. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1907. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1908. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1909. xlSheet.Range("G3:H3").Select()
  1910. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1911. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1912. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1913. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1914. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1915. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1916. xlSheet.Range("I3:J3").Select()
  1917. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1918. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1919. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1920. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1921. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1922. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1923. xlSheet.Range("K3:L3").Select()
  1924. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1925. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1926. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1927. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1928. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1929. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1930. xlSheet.Range("M3:N3").Select()
  1931. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1932. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1933. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1934. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1935. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlMedium : End With
  1936. myExcel.Selection.Borders(xlInsideVertical).LineStyle = xlNone : myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1937. xlSheet.Range("A3:B3").Select()
  1938. With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 13421823 : .TintAndShade = 0 : .PatternTintAndShade = 0 : End With
  1939. xlSheet.Range("C3:L3").Select()
  1940. With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent1 : .TintAndShade = 0.799981688894314
  1941. .PatternTintAndShade = 0 : End With
  1942. xlSheet.Range("M3:N3").Select()
  1943. With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 5296274 : .TintAndShade = 0 : .PatternTintAndShade = 0 : End With
  1944. xlSheet.Columns("A:B").Select : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = -0.249977111117893 : End With
  1945. xlSheet.Columns("M:N").Select : With myExcel.Selection.Font : .ThemeColor = xlThemeColorAccent6 : .TintAndShade = -0.249977111117893 : End With
  1946. xlSheet.Range("A1:N1").Select()
  1947. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1948. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1949. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 16 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1950. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1951. xlSheet.Range("A2:N2").Select()
  1952. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1953. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
  1954. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 14 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1955. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1956. xlSheet.Rows("1:2").Select : With myExcel.Selection.Font : .ColorIndex = xlAutomatic : .TintAndShade = 0 : End With
  1957. End Sub
  1958. End Class