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 175KB

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