12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238 |
- Option Strict Off
- Imports System.Data.SqlClient
- Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
- Imports Microsoft.Office.Interop.Excel.Constants
- Imports Microsoft.Office.Interop.Excel.XlBordersIndex
- Imports Microsoft.Office.Interop.Excel.XlLineStyle
- Imports Microsoft.Office.Interop.Excel.XlBorderWeight
- Imports Microsoft.Office.Interop.Excel.XlThemeFont
- Imports Microsoft.Office.Interop.Excel.XlThemeColor
- Imports Microsoft.Office.Interop.Excel.XlWindowState
- Imports Microsoft.Office.Interop.Excel
- Public Class 訂單價格利潤明細表
- ReadOnly conn As New SqlConnection
- ReadOnly da As New SqlDataAdapter
- ReadOnly cmd As New SqlCommand
- ReadOnly ds As New DataSet : ReadOnly ds1 As New DataSet : ReadOnly ds2 As New DataSet
- Dim dr As SqlDataReader
- Dim xlApp As Application
- Dim xlBook As Workbook
- Dim xlSheet As Worksheet
- ReadOnly BB(3) As Boolean : Dim WW As String : Public 平均數 As Integer : Public 最終數 As Integer = 0 : Public 資料數 As Integer = 0 : Dim NUM2 As Integer : Dim N1 As Integer
- ReadOnly MYSQL1 As String = "SELECT 訂單控制表.BUYER, 訂單控制表.年份季度, 訂單控制表.訂單流水號, 訂單控制表.客戶訂單號, 訂單控制表.型體號碼, 訂單控制表.GOODBOX AS 型體名稱, 訂單控制表.APMA確認 AS 顏色,
- 訂單控制表.TVW AS 楦型, 訂單控制表.訂單數量, 訂單控制表.客戶交期 AS 交期開始, 訂單控制表.客戶交期1 AS 交期結束, 訂單控制表.單價, 訂單控制表.總金額 AS 銷售金額,
- 訂單控制表.備註, 訂單控制表.生產工廠, 訂單控制表.資料流水號, 訂單價格利潤明細表.Quantity, 訂單價格利潤明細表.Currency, 訂單價格利潤明細表.Exchange,
- 訂單價格利潤明細表.Price, 訂單價格利潤明細表.Discount_price AS [Discount price], 訂單價格利潤明細表.Commercial_invoice AS [Commercial invoice],
- 訂單價格利潤明細表.Overage_invoice AS [Overage invoice], 訂單價格利潤明細表.Selling_price AS [Selling price], 訂單價格利潤明細表.HTS_code AS [HTS code],
- 訂單價格利潤明細表.Remark1, 訂單價格利潤明細表.Fty_price AS [Fty price], 訂單價格利潤明細表.Mold_cost AS [Mold cost],
- 訂單價格利潤明細表.Collected_mold_cost AS [Collected mold cost], 訂單價格利潤明細表.Amortization_qty AS [Amortization qty], 訂單價格利潤明細表.Profit,
- 訂單價格利潤明細表.Commission, 訂單價格利潤明細表.Remark2, 訂單價格利潤明細表.Price AS 客戶付款, 訂單價格利潤明細表.Price AS 未收款項,
- 訂單價格利潤明細表.Price AS 預收款項, 訂單價格利潤明細表.Price AS 成本金額, 訂單價格利潤明細表.Price AS 利潤, 訂單價格利潤明細表.Price AS 實際收款,
- 訂單價格利潤明細表.年份, 訂單價格利潤明細表.利潤表流水號, 訂單價格利潤明細表.審核
- FROM 訂單控制表 LEFT OUTER JOIN 訂單價格利潤明細表 ON 訂單控制表.資料流水號 = 訂單價格利潤明細表.資料流水號 "
- ReadOnly MYSQL2 As String = "SELECT 訂單控制表.BUYER, 訂單控制表.年份季度, 訂單控制表.訂單流水號, 訂單控制表.客戶訂單號, 訂單控制表.型體號碼, 訂單控制表.GOODBOX AS 型體名稱,
- 訂單控制表.APMA確認 AS 顏色, 訂單控制表.TVW AS 楦型, 訂單控制表.訂單數量, 訂單控制表.客戶交期 AS 交期開始, 訂單控制表.客戶交期1 AS 交期結束, 訂單控制表.單價,
- 訂單控制表.總金額 AS 銷售金額, 訂單控制表.備註, 訂單控制表.生產工廠, 訂單控制表.資料流水號, 訂單價格利潤明細表.Quantity, 訂單價格利潤明細表.Currency,
- 訂單價格利潤明細表.Exchange, 訂單價格利潤明細表.Price, 訂單價格利潤明細表.Discount_price AS [Discount price],
- 訂單價格利潤明細表.Commercial_invoice AS [Commercial invoice], 訂單價格利潤明細表.Overage_invoice AS [Overage invoice],
- 訂單價格利潤明細表.Selling_price AS [Selling price], 訂單價格利潤明細表.HTS_code AS [HTS code], 訂單價格利潤明細表.Remark1,
- 訂單價格利潤明細表.Fty_price AS [Fty price], 訂單價格利潤明細表.Mold_cost AS [Mold cost], 訂單價格利潤明細表.Collected_mold_cost AS [Collected mold cost],
- 訂單價格利潤明細表.Amortization_qty AS [Amortization qty], 訂單價格利潤明細表.Profit, 訂單價格利潤明細表.Commission, 訂單價格利潤明細表.Remark2,
- 訂單價格利潤明細表.Price AS 客戶付款, 訂單價格利潤明細表.Price AS 未收款項, 訂單價格利潤明細表.Price AS 預收款項, 訂單價格利潤明細表.Price AS 成本金額,
- 訂單價格利潤明細表.Price AS 利潤, 訂單價格利潤明細表.Price AS 實際收款, 訂單價格利潤明細表.年份, 訂單價格利潤表暫存檔.利潤表流水號, 訂單價格利潤明細表.審核
- FROM 訂單控制表 INNER JOIN 訂單價格利潤表暫存檔 ON 訂單控制表.資料流水號 = 訂單價格利潤表暫存檔.資料流水號 LEFT OUTER JOIN
- 訂單價格利潤明細表 ON 訂單控制表.資料流水號 = 訂單價格利潤明細表.資料流水號
- ORDER BY 訂單控制表.訂單流水號 DESC"
- Private Sub Set_DGV1載入前設定()
- DataGridView1.DataSource = Nothing : ds.Clear()
- DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView1.ColumnHeadersHeight = 50
- DataGridView1.AllowUserToAddRows = False
- DataGridView1.RowTemplate.Height = 35
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- End Sub
- Private Sub Set_DGV1載入後設定()
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_訂單清單1()
- Set_DGV1載入前設定()
- If CheckBox1.Checked = True Then
- Timer1.Enabled = True : Button6.Enabled = True : Button5.Enabled = False : Button9.Enabled = False
- Button11.Enabled = True : Button12.Enabled = True : Button13.Enabled = True
- If TextBox1.Text = "" Then
- SQL1 = MYSQL1 & "WHERE ((訂單控制表.訂單流水號 Like '%" & PA & "%') OR (訂單控制表.年份季度 LIKE '%" & PA & "%') OR (訂單控制表.客戶訂單號 LIKE '%" & PA & "%') OR
- (訂單控制表.型體號碼 Like '%" & PA & "%') OR (訂單控制表.APMA確認 LIKE '%" & PA & "%') OR (訂單控制表.GOODBOX LIKE '%" & PA & "%') OR
- (訂單控制表.TVW Like '%" & PA & "%') OR (訂單控制表.備註 LIKE '%" & PA & "%') OR (訂單控制表.生產工廠 LIKE '%" & PA & "%')) AND
- (訂單價格利潤明細表.訂單流水號 Is Not NULL) AND (訂單價格利潤明細表.CFMSPEC LIKE 'LANDED BRANDED')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- Else
- SQL1 = MYSQL1 & "WHERE (訂單控制表.訂單流水號 LIKE '" & TextBox1.Text & "') AND (訂單控制表.CXL IS NULL OR 訂單控制表.CXL = 0) AND (訂單控制表.CFMSPEC LIKE 'LANDED BRANDED')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- End If
- Set_DGV1載入後設定() : Set_grid() : Set_自動彙總1()
- Set_暫存資料設定() : Set_編輯清單1() : Set_grid() : Set_grid3() : Set_自動彙總1()
- ElseIf CheckBox1.Checked = False Then
- Timer1.Enabled = False : Label47.Visible = False : Button6.Enabled = False : Button5.Enabled = True : Button9.Enabled = True
- Button11.Enabled = False : Button12.Enabled = False : Button13.Enabled = False
- If PA = "" Then
- SQL1 = MYSQL1 & "WHERE (訂單控制表.CXL IS NULL) OR (訂單控制表.CXL = 0) AND (訂單價格利潤明細表.年份 LIKE '" & ComboBox1.Text & "') AND (訂單控制表.CFMSPEC LIKE 'LANDED BRANDED')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- Else
- SQL1 = MYSQL1 & "WHERE ((訂單控制表.訂單流水號 Like '%" & PA & "%') OR (訂單控制表.年份季度 LIKE '%" & PA & "%') OR (訂單控制表.客戶訂單號 LIKE '%" & PA & "%') OR
- (訂單控制表.型體號碼 LIKE '%" & PA & "%') OR (訂單控制表.APMA確認 LIKE '%" & PA & "%') OR (訂單控制表.GOODBOX LIKE '%" & PA & "%') OR
- (訂單控制表.TVW LIKE '%" & PA & "%') OR (訂單控制表.備註 LIKE '%" & PA & "%') OR (訂單控制表.生產工廠 LIKE '%" & PA & "%')) AND
- (訂單價格利潤明細表.訂單流水號 IS NOT NULL) AND (訂單價格利潤明細表.年份 LIKE '" & ComboBox1.Text & "') AND
- (訂單控制表.CXL IS NULL OR 訂單控制表.CXL = 0) AND (訂單控制表.CFMSPEC LIKE 'LANDED BRANDED')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- End If
- 列印用SQL = SQL1
- Set_DGV1載入後設定()
- End If
- End Sub
- Private Sub Set_編輯清單1()
- Set_DGV1載入前設定() : SQL1 = MYSQL2 : Set_DGV1載入後設定() : Me.Button13.PerformClick() : Me.Button11.PerformClick()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1 : DataGridView1.Rows(i).Cells("Currency").Value = "USD" : DataGridView1.Rows(i).Cells("年份").Value = ComboBox1.Text : Next i
- End Sub
- Private Sub Set_DGV3載入前設定()
- DataGridView3.DataSource = Nothing : ds2.Clear()
- DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView3.ColumnHeadersHeight = 50
- DataGridView3.AllowUserToAddRows = False
- DataGridView3.RowTemplate.Height = 35
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- End Sub
- Private Sub Set_DGV3載入後設定()
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_訂單清單2()
- Set_DGV3載入前設定()
- If CheckBox1.Checked = True Then
- Timer1.Enabled = True : Button6.Enabled = True : Button5.Enabled = False : Button9.Enabled = False
- Button11.Enabled = True : Button12.Enabled = True : Button13.Enabled = True
- If TextBox1.Text = "" Then
- SQL1 = MYSQL1 & "WHERE ((訂單控制表.訂單流水號 Like '%" & PA & "%') OR (訂單控制表.年份季度 LIKE '%" & PA & "%') OR (訂單控制表.客戶訂單號 LIKE '%" & PA & "%') OR
- (訂單控制表.型體號碼 Like '%" & PA & "%') OR (訂單控制表.APMA確認 LIKE '%" & PA & "%') OR (訂單控制表.GOODBOX LIKE '%" & PA & "%') OR
- (訂單控制表.TVW Like '%" & PA & "%') OR (訂單控制表.備註 LIKE '%" & PA & "%') OR (訂單控制表.生產工廠 LIKE '%" & PA & "%')) AND
- (訂單價格利潤明細表.訂單流水號 Is Not NULL) AND (訂單控制表.CFMSPEC LIKE 'FIRST COST')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- Else
- SQL1 = MYSQL1 & "WHERE (訂單控制表.訂單流水號 LIKE '" & TextBox1.Text & "') AND (訂單控制表.CXL IS NULL OR 訂單控制表.CXL = 0) AND (訂單控制表.CFMSPEC LIKE 'FIRST COST')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- End If
- Set_DGV3載入後設定() : Set_grid3() : Set_自動彙總1()
- Set_暫存資料設定() : Set_編輯清單2() : Set_grid3() : Set_自動彙總1()
- ElseIf CheckBox1.Checked = False Then
- Timer1.Enabled = False : Label47.Visible = False : Button6.Enabled = False : Button5.Enabled = True : Button9.Enabled = True
- Button11.Enabled = False : Button12.Enabled = False : Button13.Enabled = False
- If PA = "" Then
- SQL1 = MYSQL1 & "WHERE (訂單控制表.CXL IS NULL) OR (訂單控制表.CXL = 0) AND (訂單價格利潤明細表.年份 LIKE '" & ComboBox1.Text & "') AND (訂單控制表.CFMSPEC LIKE 'FIRST COST')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- Else
- SQL1 = MYSQL1 & "WHERE ((訂單控制表.訂單流水號 Like '%" & PA & "%') OR (訂單控制表.年份季度 LIKE '%" & PA & "%') OR (訂單控制表.客戶訂單號 LIKE '%" & PA & "%') OR
- (訂單控制表.型體號碼 LIKE '%" & PA & "%') OR (訂單控制表.APMA確認 LIKE '%" & PA & "%') OR (訂單控制表.GOODBOX LIKE '%" & PA & "%') OR
- (訂單控制表.TVW LIKE '%" & PA & "%') OR (訂單控制表.備註 LIKE '%" & PA & "%') OR (訂單控制表.生產工廠 LIKE '%" & PA & "%')) AND
- (訂單價格利潤明細表.訂單流水號 IS NOT NULL) AND (訂單價格利潤明細表.年份 LIKE '" & ComboBox1.Text & "') AND
- (訂單控制表.CXL IS NULL OR 訂單控制表.CXL = 0) AND (訂單控制表.CFMSPEC LIKE 'FIRST COST')
- ORDER BY 訂單控制表.訂單流水號 DESC"
- End If
- 列印用SQL = SQL1
- Set_DGV3載入後設定()
- End If
- End Sub
- Private Sub Set_編輯清單2()
- Set_DGV3載入前設定() : SQL1 = MYSQL2 : Set_DGV3載入後設定() : Me.Button13.PerformClick() : Me.Button11.PerformClick()
- For i As Integer = 0 To DataGridView3.Rows.Count - 1 : DataGridView3.Rows(i).Cells("Currency").Value = "USD" : DataGridView3.Rows(i).Cells("年份").Value = ComboBox1.Text : Next i
- End Sub
- Private Sub Set_暫存資料設定()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "DELETE FROM 訂單價格利潤表暫存檔"
- cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : cmd.ExecuteNonQuery() : conn.Close()
-
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT TOP (1) 利潤表流水號 FROM 訂單價格利潤明細表 ORDER BY 利潤表流水號 DESC"
- cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
- If dr.Read() Then : NUM2 = Strings.Right(dr("利潤表流水號").ToString, 8) : End If
- conn.Close()
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- Set_暫存資料設定1()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "INSERT INTO 訂單價格利潤表暫存檔 (資料流水號, 利潤表流水號, 訂單流水號) " &
- "VALUES ('" & DataGridView1.Rows(i).Cells("資料流水號").Value & "','" & WW & "', '" & DataGridView1.Rows(i).Cells("訂單流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- Next i
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1
- Set_暫存資料設定1()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "INSERT INTO 訂單價格利潤表暫存檔 (資料流水號, 利潤表流水號, 訂單流水號) " &
- "VALUES ('" & DataGridView3.Rows(i).Cells("資料流水號").Value & "','" & WW & "', '" & DataGridView3.Rows(i).Cells("訂單流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- Next i
- End If
- End Sub
- Private Sub Set_暫存資料設定1()
- NUM2 += 1
- If NUM2 < 10 Then : WW = "PR" & "0000000" & NUM2
- ElseIf NUM2 > 9 And NUM2 < 100 Then : WW = "PR" & "000000" & NUM2
- ElseIf NUM2 > 99 And NUM2 < 1000 Then : WW = "PR" & "00000" & NUM2
- ElseIf NUM2 > 999 And NUM2 < 10000 Then : WW = "PR" & "0000" & NUM2
- ElseIf NUM2 > 9999 And NUM2 < 100000 Then : WW = "PR" & "000" & NUM2
- ElseIf NUM2 > 99999 And NUM2 < 100000 Then : WW = "PR" & "00" & NUM2
- ElseIf NUM2 > 999999 And NUM2 < 1000000 Then : WW = "PR" & "0" & NUM2
- ElseIf NUM2 > 9999999 Then : WW = "PR" & NUM2
- End If
- End Sub
- Private Sub Set_未建檔清單()
- DataGridView2.DataSource = Nothing : ds1.Clear()
- DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView2.ColumnHeadersHeight = 25
- DataGridView2.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 訂單控制表.訂單流水號
- FROM 訂單控制表 FULL OUTER JOIN 訂單價格利潤明細表 ON 訂單控制表.資料流水號 = 訂單價格利潤明細表.資料流水號
- WHERE (訂單控制表.CXL IS NULL OR 訂單控制表.CXL = 0) AND (訂單控制表.CFMSPEC LIKE '" & ComboBox10.Text & "') AND
- (訂單價格利潤明細表.資料流水號 IS NULL) AND (訂單控制表.CFMSPEC LIKE '" & ComboBox10.Text & "')
- GROUP BY 訂單控制表.訂單流水號
- ORDER BY 訂單控制表.訂單流水號 DESC"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.SelectCommand.CommandTimeout = 900 : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_grid()
- DataGridView1.Columns(0).ReadOnly = True : DataGridView1.Columns(1).ReadOnly = True : DataGridView1.Columns(2).ReadOnly = True : DataGridView1.Columns(3).ReadOnly = True
- DataGridView1.Columns(4).ReadOnly = True : DataGridView1.Columns(5).ReadOnly = True : DataGridView1.Columns(6).ReadOnly = True : DataGridView1.Columns(7).ReadOnly = True
- DataGridView1.Columns(8).ReadOnly = True : DataGridView1.Columns(9).ReadOnly = True : DataGridView1.Columns(10).ReadOnly = True : DataGridView1.Columns(12).ReadOnly = True
- DataGridView1.Columns(13).ReadOnly = True : DataGridView1.Columns(14).ReadOnly = True : DataGridView1.Columns(20).ReadOnly = True : DataGridView1.Columns(22).ReadOnly = True
- DataGridView1.Columns(28).ReadOnly = True : DataGridView1.Columns(30).ReadOnly = True : DataGridView1.Columns(31).ReadOnly = True : DataGridView1.Columns(33).ReadOnly = True
- DataGridView1.Columns(34).ReadOnly = True : DataGridView1.Columns(35).ReadOnly = True : DataGridView1.Columns(36).ReadOnly = True : DataGridView1.Columns(37).ReadOnly = True
- DataGridView1.Columns(38).ReadOnly = True : DataGridView1.Columns(39).ReadOnly = True : DataGridView1.Columns(40).ReadOnly = True
- '764
- DataGridView1.Columns(0).Width = 90 : DataGridView1.Columns(1).Width = 100 : DataGridView1.Columns(2).Width = 115 : DataGridView1.Columns(3).Width = 80
- DataGridView1.Columns(4).Width = 90 : DataGridView1.Columns(5).Width = 90 : DataGridView1.Columns(6).Width = 100 : DataGridView1.Columns(7).Width = 50
- DataGridView1.Columns(8).Width = 60 : DataGridView1.Columns(9).Width = 70 : DataGridView1.Columns(10).Width = 70 : DataGridView1.Columns(11).Width = 60
- DataGridView1.Columns(12).Width = 80 : DataGridView1.Columns(13).Width = 100 : DataGridView1.Columns(14).Width = 80 : DataGridView1.Columns(15).Visible = False
- DataGridView1.Columns(16).Width = 60 : DataGridView1.Columns(17).Width = 60 : DataGridView1.Columns(18).Width = 65 : DataGridView1.Columns(19).Width = 60
- DataGridView1.Columns(20).Width = 70 : DataGridView1.Columns(21).Width = 80 : DataGridView1.Columns(22).Width = 70
-
- DataGridView1.Columns(23).Visible = False : DataGridView1.Columns(24).Visible = False
-
- DataGridView1.Columns(25).Width = 168 : DataGridView1.Columns(26).Width = 60 : DataGridView1.Columns(27).Width = 60 : DataGridView1.Columns(28).Width = 80 : DataGridView1.Columns(29).Width = 100
- DataGridView1.Columns(30).Width = 80 : DataGridView1.Columns(31).Width = 80 : DataGridView1.Columns(31).Width = 100 : DataGridView1.Columns(32).Width = 263 : DataGridView1.Columns(39).Width = 70
- DataGridView1.Columns(40).Width = 85 : DataGridView1.Columns(41).Width = 57
-
- DataGridView1.Columns(8).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(11).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(12).DefaultCellStyle.Format = "#,##0.00"
- DataGridView1.Columns(16).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(18).DefaultCellStyle.Format = "#,##0.0000" : DataGridView1.Columns(19).DefaultCellStyle.Format = "#,##0.00"
- DataGridView1.Columns(20).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(21).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(22).DefaultCellStyle.Format = "#,##0.00"
- DataGridView1.Columns(26).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(27).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(28).DefaultCellStyle.Format = "#,##0.00"
- DataGridView1.Columns(29).DefaultCellStyle.Format = "#,##0" : DataGridView1.Columns(30).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(31).DefaultCellStyle.Format = "#,##0.00"
- DataGridView1.Columns(33).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(34).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(35).DefaultCellStyle.Format = "#,##0.00"
- DataGridView1.Columns(36).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(37).DefaultCellStyle.Format = "#,##0.00" : DataGridView1.Columns(38).DefaultCellStyle.Format = "#,##0.00"
- DataGridView1.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(8).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(11).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(11).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(12).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(16).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(16).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(17).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(17).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(18).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(18).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(19).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(19).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(20).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(20).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(21).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(21).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(22).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(22).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(26).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(26).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(27).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(27).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(28).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(28).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(29).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(29).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(30).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(30).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(31).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(31).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(33).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(33).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(34).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(34).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(35).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(35).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(36).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(36).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(37).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(37).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(38).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(38).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(39).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(39).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(40).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(40).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView1.Columns(41).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView1.Columns(41).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
-
- DataGridView1.Columns(11).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(16).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView1.Columns(17).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(18).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView1.Columns(19).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(21).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView1.Columns(26).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView1.Columns(27).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView1.Columns(29).DefaultCellStyle.BackColor = Color.MistyRose
-
- DataGridView1.Columns(0).DefaultCellStyle.ForeColor = Color.Blue : DataGridView1.Columns(1).DefaultCellStyle.ForeColor = Color.Blue
- DataGridView1.Columns(2).DefaultCellStyle.ForeColor = Color.Blue : DataGridView1.Columns(3).DefaultCellStyle.ForeColor = Color.Blue
- DataGridView1.Columns(4).DefaultCellStyle.ForeColor = Color.Blue : DataGridView1.Columns(5).DefaultCellStyle.ForeColor = Color.Blue
- DataGridView1.Columns(6).DefaultCellStyle.ForeColor = Color.Blue : DataGridView1.Columns(7).DefaultCellStyle.ForeColor = Color.Blue
- DataGridView1.Columns(8).DefaultCellStyle.ForeColor = Color.Blue : DataGridView1.Columns(9).DefaultCellStyle.ForeColor = Color.Blue
- DataGridView1.Columns(10).DefaultCellStyle.ForeColor = Color.Blue
-
- DataGridView1.Columns(12).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(20).DefaultCellStyle.ForeColor = Color.Red
- DataGridView1.Columns(22).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(28).DefaultCellStyle.ForeColor = Color.Red
- DataGridView1.Columns(30).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(31).DefaultCellStyle.ForeColor = Color.Red
- DataGridView1.Columns(33).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(36).DefaultCellStyle.ForeColor = Color.Red
- DataGridView1.Columns(34).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(37).DefaultCellStyle.ForeColor = Color.Red
- DataGridView1.Columns(35).DefaultCellStyle.ForeColor = Color.Red : DataGridView1.Columns(38).DefaultCellStyle.ForeColor = Color.Red
-
- If BB(0) = True And BB(1) = False And BB(2) = False And BB(3) = False Then
- DataGridView1.Columns(17).Visible = True : DataGridView1.Columns(18).Visible = True : DataGridView1.Columns(19).Visible = True : DataGridView1.Columns(20).Visible = True
- DataGridView1.Columns(21).Visible = True : DataGridView1.Columns(22).Visible = True : DataGridView1.Columns(25).Visible = True : DataGridView1.Columns(13).Visible = True
- DataGridView1.Columns(14).Visible = True : DataGridView1.Columns(16).Visible = True
-
- DataGridView1.Columns(26).Visible = False : DataGridView1.Columns(27).Visible = False : DataGridView1.Columns(28).Visible = False : DataGridView1.Columns(29).Visible = False
- DataGridView1.Columns(30).Visible = False : DataGridView1.Columns(31).Visible = False : DataGridView1.Columns(32).Visible = False : DataGridView1.Columns(33).Visible = False
- DataGridView1.Columns(34).Visible = False : DataGridView1.Columns(35).Visible = False : DataGridView1.Columns(36).Visible = False : DataGridView1.Columns(37).Visible = False
- DataGridView1.Columns(38).Visible = False : DataGridView1.Columns(39).Visible = False : DataGridView1.Columns(40).Visible = False : DataGridView1.Columns(41).Visible = False
- ElseIf BB(0) = False And BB(1) = True And BB(2) = False And BB(3) = False Then
- DataGridView1.Columns(17).Visible = False : DataGridView1.Columns(18).Visible = False : DataGridView1.Columns(19).Visible = False : DataGridView1.Columns(20).Visible = False
- DataGridView1.Columns(21).Visible = False : DataGridView1.Columns(22).Visible = False : DataGridView1.Columns(25).Visible = False : DataGridView1.Columns(13).Visible = False
- DataGridView1.Columns(14).Visible = False : DataGridView1.Columns(16).Visible = False
-
- DataGridView1.Columns(26).Visible = True : DataGridView1.Columns(27).Visible = True : DataGridView1.Columns(28).Visible = True : DataGridView1.Columns(29).Visible = True
- DataGridView1.Columns(30).Visible = True : DataGridView1.Columns(31).Visible = True : DataGridView1.Columns(32).Visible = True : DataGridView1.Columns(39).Visible = True
-
- DataGridView1.Columns(34).Visible = False : DataGridView1.Columns(35).Visible = False : DataGridView1.Columns(36).Visible = False : DataGridView1.Columns(37).Visible = False
- DataGridView1.Columns(38).Visible = False : DataGridView1.Columns(33).Visible = False : DataGridView1.Columns(40).Visible = False : DataGridView1.Columns(41).Visible = False
- ElseIf BB(0) = False And BB(1) = False And BB(2) = True And BB(3) = False Then
- DataGridView1.Columns(17).Visible = False : DataGridView1.Columns(18).Visible = False : DataGridView1.Columns(19).Visible = False : DataGridView1.Columns(20).Visible = False
- DataGridView1.Columns(21).Visible = False : DataGridView1.Columns(22).Visible = False : DataGridView1.Columns(25).Visible = False : DataGridView1.Columns(13).Visible = False
- DataGridView1.Columns(14).Visible = False : DataGridView1.Columns(16).Visible = False : DataGridView1.Columns(26).Visible = False : DataGridView1.Columns(27).Visible = False
- DataGridView1.Columns(28).Visible = False : DataGridView1.Columns(29).Visible = False : DataGridView1.Columns(30).Visible = False : DataGridView1.Columns(31).Visible = False
- DataGridView1.Columns(32).Visible = False
-
- DataGridView1.Columns(33).Visible = True : DataGridView1.Columns(34).Visible = True : DataGridView1.Columns(35).Visible = True : DataGridView1.Columns(36).Visible = True
- DataGridView1.Columns(37).Visible = True : DataGridView1.Columns(38).Visible = True : DataGridView1.Columns(39).Visible = True : DataGridView1.Columns(40).Visible = True
- DataGridView1.Columns(41).Visible = True
- End If
- DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter
- End Sub
- Private Sub Set_grid3()
- DataGridView3.Columns(0).ReadOnly = True : DataGridView3.Columns(1).ReadOnly = True : DataGridView3.Columns(2).ReadOnly = True : DataGridView3.Columns(3).ReadOnly = True
- DataGridView3.Columns(4).ReadOnly = True : DataGridView3.Columns(5).ReadOnly = True : DataGridView3.Columns(6).ReadOnly = True : DataGridView3.Columns(7).ReadOnly = True
- DataGridView3.Columns(8).ReadOnly = True : DataGridView3.Columns(9).ReadOnly = True : DataGridView3.Columns(10).ReadOnly = True : DataGridView3.Columns(12).ReadOnly = True
- DataGridView3.Columns(13).ReadOnly = True : DataGridView3.Columns(14).ReadOnly = True : DataGridView3.Columns(20).ReadOnly = True : DataGridView3.Columns(22).ReadOnly = True
- DataGridView3.Columns(28).ReadOnly = True : DataGridView3.Columns(30).ReadOnly = True : DataGridView3.Columns(31).ReadOnly = True : DataGridView3.Columns(33).ReadOnly = True
- DataGridView3.Columns(34).ReadOnly = True : DataGridView3.Columns(35).ReadOnly = True : DataGridView3.Columns(36).ReadOnly = True : DataGridView3.Columns(37).ReadOnly = True
- DataGridView3.Columns(38).ReadOnly = True : DataGridView3.Columns(39).ReadOnly = True : DataGridView3.Columns(40).ReadOnly = True
- '764
- DataGridView3.Columns(0).Width = 90 : DataGridView3.Columns(1).Width = 100 : DataGridView3.Columns(2).Width = 115 : DataGridView3.Columns(3).Width = 80
- DataGridView3.Columns(4).Width = 90 : DataGridView3.Columns(5).Width = 90 : DataGridView3.Columns(6).Width = 100 : DataGridView3.Columns(7).Width = 50
- DataGridView3.Columns(8).Width = 60 : DataGridView3.Columns(9).Width = 70 : DataGridView3.Columns(10).Width = 70 : DataGridView3.Columns(11).Width = 60
- DataGridView3.Columns(12).Width = 80 : DataGridView3.Columns(13).Width = 100 : DataGridView3.Columns(14).Width = 80 : DataGridView3.Columns(15).Visible = False
- DataGridView3.Columns(16).Width = 60 : DataGridView3.Columns(17).Width = 60 : DataGridView3.Columns(18).Width = 65 : DataGridView3.Columns(19).Width = 60
- DataGridView3.Columns(20).Width = 70
-
- DataGridView3.Columns(21).Visible = False : DataGridView3.Columns(22).Visible = False : DataGridView3.Columns(23).Width = 80 : DataGridView3.Columns(24).Width = 105
-
- DataGridView3.Columns(25).Width = 133 : DataGridView3.Columns(26).Width = 60 : DataGridView3.Columns(27).Width = 60 : DataGridView3.Columns(28).Width = 80 : DataGridView3.Columns(29).Width = 100
- DataGridView3.Columns(30).Width = 80 : DataGridView3.Columns(31).Width = 80 : DataGridView3.Columns(31).Width = 100 : DataGridView3.Columns(32).Width = 263 : DataGridView3.Columns(39).Width = 70
- DataGridView3.Columns(40).Width = 85 : DataGridView3.Columns(41).Width = 57
-
- DataGridView3.Columns(8).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(11).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(12).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(16).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(18).DefaultCellStyle.Format = "#,##0.0000" : DataGridView3.Columns(19).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(20).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(21).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(22).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(26).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(27).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(28).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(29).DefaultCellStyle.Format = "#,##0" : DataGridView3.Columns(30).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(31).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(33).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(34).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(35).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(36).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(37).DefaultCellStyle.Format = "#,##0.00" : DataGridView3.Columns(38).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(23).DefaultCellStyle.Format = "#,##0.00"
- DataGridView3.Columns(8).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(8).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(11).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(11).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(12).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(16).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(16).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(17).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(17).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(18).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(18).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(19).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(19).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(20).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(20).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(21).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(21).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(22).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(22).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(26).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(26).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(27).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(27).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(28).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(28).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(29).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(29).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(30).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(30).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(31).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(31).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(23).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(23).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(33).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(33).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(34).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(34).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(35).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(35).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(36).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(36).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(37).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(37).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(38).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(38).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(39).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(39).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(40).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(40).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
- DataGridView3.Columns(41).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter : DataGridView3.Columns(41).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
-
- DataGridView3.Columns(11).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView3.Columns(16).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView3.Columns(17).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView3.Columns(18).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView3.Columns(19).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView3.Columns(21).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView3.Columns(26).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView3.Columns(27).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView3.Columns(29).DefaultCellStyle.BackColor = Color.MistyRose : DataGridView3.Columns(23).DefaultCellStyle.BackColor = Color.MistyRose
- DataGridView3.Columns(24).DefaultCellStyle.BackColor = Color.MistyRose
-
- DataGridView3.Columns(0).DefaultCellStyle.ForeColor = Color.Green : DataGridView3.Columns(1).DefaultCellStyle.ForeColor = Color.Green
- DataGridView3.Columns(2).DefaultCellStyle.ForeColor = Color.Green : DataGridView3.Columns(3).DefaultCellStyle.ForeColor = Color.Green
- DataGridView3.Columns(4).DefaultCellStyle.ForeColor = Color.Green : DataGridView3.Columns(5).DefaultCellStyle.ForeColor = Color.Green
- DataGridView3.Columns(6).DefaultCellStyle.ForeColor = Color.Green : DataGridView3.Columns(7).DefaultCellStyle.ForeColor = Color.Green
- DataGridView3.Columns(8).DefaultCellStyle.ForeColor = Color.Green : DataGridView3.Columns(9).DefaultCellStyle.ForeColor = Color.Green
- DataGridView3.Columns(10).DefaultCellStyle.ForeColor = Color.Green
-
- DataGridView3.Columns(12).DefaultCellStyle.ForeColor = Color.Red : DataGridView3.Columns(20).DefaultCellStyle.ForeColor = Color.Red
- DataGridView3.Columns(22).DefaultCellStyle.ForeColor = Color.Red : DataGridView3.Columns(28).DefaultCellStyle.ForeColor = Color.Red
- DataGridView3.Columns(30).DefaultCellStyle.ForeColor = Color.Red : DataGridView3.Columns(31).DefaultCellStyle.ForeColor = Color.Red
- DataGridView3.Columns(33).DefaultCellStyle.ForeColor = Color.Red : DataGridView3.Columns(36).DefaultCellStyle.ForeColor = Color.Red
- DataGridView3.Columns(34).DefaultCellStyle.ForeColor = Color.Red : DataGridView3.Columns(37).DefaultCellStyle.ForeColor = Color.Red
- DataGridView3.Columns(35).DefaultCellStyle.ForeColor = Color.Red : DataGridView3.Columns(38).DefaultCellStyle.ForeColor = Color.Red
-
- If BB(0) = True And BB(1) = False And BB(2) = False And BB(3) = False Then
- DataGridView3.Columns(17).Visible = True : DataGridView3.Columns(18).Visible = True : DataGridView3.Columns(19).Visible = True : DataGridView3.Columns(20).Visible = True
- DataGridView3.Columns(23).Visible = True : DataGridView3.Columns(24).Visible = True : DataGridView3.Columns(25).Visible = True : DataGridView3.Columns(13).Visible = True
- DataGridView3.Columns(14).Visible = True : DataGridView3.Columns(16).Visible = True
-
- DataGridView3.Columns(26).Visible = False : DataGridView3.Columns(27).Visible = False : DataGridView3.Columns(28).Visible = False : DataGridView3.Columns(29).Visible = False
- DataGridView3.Columns(30).Visible = False : DataGridView3.Columns(31).Visible = False : DataGridView3.Columns(32).Visible = False : DataGridView3.Columns(33).Visible = False
- DataGridView3.Columns(34).Visible = False : DataGridView3.Columns(35).Visible = False : DataGridView3.Columns(36).Visible = False : DataGridView3.Columns(37).Visible = False
- DataGridView3.Columns(38).Visible = False : DataGridView3.Columns(39).Visible = False : DataGridView3.Columns(40).Visible = False : DataGridView3.Columns(41).Visible = False
- ElseIf BB(0) = False And BB(1) = True And BB(2) = False And BB(3) = False Then
- DataGridView3.Columns(17).Visible = False : DataGridView3.Columns(18).Visible = False : DataGridView3.Columns(19).Visible = False : DataGridView3.Columns(20).Visible = False
- DataGridView3.Columns(23).Visible = False : DataGridView3.Columns(24).Visible = False : DataGridView3.Columns(25).Visible = False : DataGridView3.Columns(13).Visible = False
- DataGridView3.Columns(14).Visible = False : DataGridView3.Columns(16).Visible = False
-
- DataGridView3.Columns(26).Visible = True : DataGridView3.Columns(27).Visible = True : DataGridView3.Columns(28).Visible = True : DataGridView3.Columns(29).Visible = True
- DataGridView3.Columns(30).Visible = True : DataGridView3.Columns(31).Visible = True : DataGridView3.Columns(32).Visible = True : DataGridView3.Columns(39).Visible = True
-
- DataGridView3.Columns(34).Visible = False : DataGridView3.Columns(35).Visible = False : DataGridView3.Columns(36).Visible = False : DataGridView3.Columns(37).Visible = False
- DataGridView3.Columns(38).Visible = False : DataGridView3.Columns(33).Visible = False : DataGridView3.Columns(40).Visible = False : DataGridView3.Columns(41).Visible = False
- ElseIf BB(0) = False And BB(1) = False And BB(2) = True And BB(3) = False Then
- DataGridView3.Columns(17).Visible = False : DataGridView3.Columns(18).Visible = False : DataGridView3.Columns(19).Visible = False : DataGridView3.Columns(20).Visible = False
- DataGridView3.Columns(23).Visible = False : DataGridView3.Columns(24).Visible = False : DataGridView3.Columns(25).Visible = False : DataGridView3.Columns(13).Visible = False
- DataGridView3.Columns(14).Visible = False : DataGridView3.Columns(16).Visible = False : DataGridView3.Columns(26).Visible = False : DataGridView3.Columns(27).Visible = False
- DataGridView3.Columns(28).Visible = False : DataGridView3.Columns(29).Visible = False : DataGridView3.Columns(30).Visible = False : DataGridView3.Columns(31).Visible = False
- DataGridView3.Columns(32).Visible = False
-
- DataGridView3.Columns(33).Visible = True : DataGridView3.Columns(34).Visible = True : DataGridView3.Columns(35).Visible = True : DataGridView3.Columns(36).Visible = True
- DataGridView3.Columns(37).Visible = True : DataGridView3.Columns(38).Visible = True : DataGridView3.Columns(39).Visible = True : DataGridView3.Columns(40).Visible = True
- DataGridView3.Columns(41).Visible = True
- End If
- DataGridView3.EditMode = DataGridViewEditMode.EditOnEnter
- End Sub
- Private Sub Set_grid1()
- DataGridView2.Columns(0).FillWeight = 100
- End Sub
- Private Sub Set_自動彙總1()
- TextBox2.Text = "0" : TextBox19.Text = "0" : TextBox34.Text = "0" : TextBox3.Text = "0" : TextBox4.Text = "0" : TextBox36.Text = "0" : TextBox5.Text = "0" : TextBox11.Text = "0"
- TextBox35.Text = "0" : TextBox9.Text = "0" : TextBox20.Text = "0" : TextBox33.Text = "0" : TextBox21.Text = "0" : TextBox22.Text = "0" : TextBox32.Text = "0" : TextBox24.Text = "0"
- TextBox23.Text = "0" : TextBox31.Text = "0" : TextBox26.Text = "0" : TextBox25.Text = "0" : TextBox30.Text = "0" : TextBox28.Text = "0" : TextBox27.Text = "0" : TextBox29.Text = "0"
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- If DataGridView1("Discount price", i).Value.ToString = "" Then : DataGridView1("Discount price", i).Value = 0 : End If
- If DataGridView1("Commercial invoice", i).Value.ToString = "" Then : DataGridView1("Commercial invoice", i).Value = 0 : End If
- If DataGridView1("Mold cost", i).Value.ToString = "" Then : DataGridView1("Mold cost", i).Value = 0 : End If
- If DataGridView1("Fty price", i).Value.ToString = "" Then : DataGridView1("Fty price", i).Value = 0 : End If
-
- DataGridView1("銷售金額", i).Value = Double.Parse(DataGridView1("單價", i).Value.ToString) * Double.Parse(DataGridView1("訂單數量", i).Value)
- DataGridView1("Discount price", i).Value = Double.Parse(DataGridView1("單價", i).Value.ToString)
- DataGridView1("Overage invoice", i).Value = Double.Parse(DataGridView1("Discount price", i).Value.ToString) - Double.Parse(DataGridView1("Commercial invoice", i).Value)
- DataGridView1("Collected mold cost", i).Value = Double.Parse(DataGridView1("Mold cost", i).Value.ToString) * Double.Parse(DataGridView1("訂單數量", i).Value)
- If Double.Parse(DataGridView1("Discount price", i).Value.ToString) - Double.Parse(DataGridView1("Mold cost", i).Value) = 0 Then
- DataGridView1("Profit", i).Value = 0
- Else
- DataGridView1("Profit", i).Value = (Double.Parse(DataGridView1("Discount price", i).Value.ToString) - Double.Parse(DataGridView1("Mold cost", i).Value) -
- Double.Parse(DataGridView1("Fty price", i).Value)) / (Double.Parse(DataGridView1("Discount price", i).Value.ToString) -
- Double.Parse(DataGridView1("Mold cost", i).Value)) * 100
- End If
- DataGridView1("Commission", i).Value = (Double.Parse(DataGridView1("單價", i).Value.ToString) - Double.Parse(DataGridView1("Fty price", i).Value) -
- Double.Parse(DataGridView1("Mold cost", i).Value)) * Double.Parse(DataGridView1("訂單數量", i).Value)
- DataGridView1("客戶付款", i).Value = Double.Parse(DataGridView1("Commercial invoice", i).Value.ToString) * Double.Parse(DataGridView1("訂單數量", i).Value)
- DataGridView1("未收款項", i).Value = Double.Parse(DataGridView1("Overage invoice", i).Value.ToString) * Double.Parse(DataGridView1("訂單數量", i).Value)
- DataGridView1("預收款項", i).Value = 0
- DataGridView1("成本金額", i).Value = (Double.Parse(DataGridView1("Fty price", i).Value.ToString) + Double.Parse(DataGridView1("Mold cost", i).Value)) *
- Double.Parse(DataGridView1("訂單數量", i).Value)
- DataGridView1("利潤", i).Value = (Double.Parse(DataGridView1("銷售金額", i).Value.ToString) - Double.Parse(DataGridView1("成本金額", i).Value))
- DataGridView1("實際收款", i).Value = (Double.Parse(DataGridView1("利潤", i).Value.ToString) - Double.Parse(DataGridView1("未收款項", i).Value))
- TextBox2.Text = Val(TextBox2.Text) + Double.Parse(DataGridView1("訂單數量", i).Value) : TextBox3.Text = Val(TextBox3.Text) + Double.Parse(DataGridView1("銷售金額", i).Value)
- TextBox5.Text = Val(TextBox5.Text) + Double.Parse(DataGridView1("客戶付款", i).Value) : TextBox9.Text = Val(TextBox9.Text) + Double.Parse(DataGridView1("未收款項", i).Value)
- TextBox21.Text = Val(TextBox21.Text) + Double.Parse(DataGridView1("預收款項", i).Value) : TextBox24.Text = Val(TextBox24.Text) + Double.Parse(DataGridView1("成本金額", i).Value)
- TextBox26.Text = Val(TextBox26.Text) + Double.Parse(DataGridView1("利潤", i).Value) : TextBox28.Text = Val(TextBox28.Text) + Double.Parse(DataGridView1("實際收款", i).Value)
- Next
-
- For i As Integer = 0 To DataGridView3.Rows.Count - 1
- If DataGridView3("Discount price", i).Value.ToString = "" Then : DataGridView3("Discount price", i).Value = 0 : End If
- If DataGridView3("Commercial invoice", i).Value.ToString = "" Then : DataGridView3("Commercial invoice", i).Value = 0 : End If
- If DataGridView3("Mold cost", i).Value.ToString = "" Then : DataGridView3("Mold cost", i).Value = 0 : End If
- If DataGridView3("Fty price", i).Value.ToString = "" Then : DataGridView3("Fty price", i).Value = 0 : End If
- If DataGridView3("Selling price", i).Value.ToString = "" Then : DataGridView3("Selling price", i).Value = 0 : End If
-
- DataGridView3("銷售金額", i).Value = Double.Parse(DataGridView3("單價", i).Value.ToString) * Double.Parse(DataGridView3("訂單數量", i).Value)
- DataGridView3("Discount price", i).Value = Double.Parse(DataGridView3("單價", i).Value.ToString)
- DataGridView3("Overage invoice", i).Value = Double.Parse(DataGridView3("Discount price", i).Value.ToString) - Double.Parse(DataGridView3("Commercial invoice", i).Value)
- DataGridView3("Collected mold cost", i).Value = Double.Parse(DataGridView3("Mold cost", i).Value.ToString) * Double.Parse(DataGridView3("訂單數量", i).Value)
- If Double.Parse(DataGridView3("Discount price", i).Value.ToString) - Double.Parse(DataGridView3("Mold cost", i).Value) = 0 Then
- DataGridView3("Profit", i).Value = 0
- Else
- DataGridView3("Profit", i).Value = (Double.Parse(DataGridView3("Discount price", i).Value.ToString) - Double.Parse(DataGridView3("Mold cost", i).Value) -
- Double.Parse(DataGridView3("Fty price", i).Value)) / (Double.Parse(DataGridView3("Discount price", i).Value.ToString) -
- Double.Parse(DataGridView3("Mold cost", i).Value)) * 100
- End If
- DataGridView3("Commission", i).Value = (Double.Parse(DataGridView3("單價", i).Value.ToString) - Double.Parse(DataGridView3("Fty price", i).Value) -
- Double.Parse(DataGridView3("Mold cost", i).Value)) * Double.Parse(DataGridView3("訂單數量", i).Value)
- DataGridView3("客戶付款", i).Value = Double.Parse(DataGridView3("Selling price", i).Value.ToString) * Double.Parse(DataGridView3("訂單數量", i).Value)
- DataGridView3("未收款項", i).Value = 0
- If DataGridView3("Selling price", i).Value = 0 Then : DataGridView3("預收款項", i).Value = 0 : Else
- DataGridView3("預收款項", i).Value = (Double.Parse(DataGridView3("Selling price", i).Value.ToString) - Double.Parse(DataGridView3("Discount price", i).Value)) *
- Double.Parse(DataGridView3("訂單數量", i).Value)
- End If
- DataGridView3("成本金額", i).Value = (Double.Parse(DataGridView3("Fty price", i).Value.ToString) + Double.Parse(DataGridView3("Mold cost", i).Value)) *
- Double.Parse(DataGridView3("訂單數量", i).Value)
- DataGridView3("利潤", i).Value = (Double.Parse(DataGridView3("銷售金額", i).Value.ToString) - Double.Parse(DataGridView3("成本金額", i).Value))
- DataGridView3("實際收款", i).Value = (Double.Parse(DataGridView3("利潤", i).Value.ToString) + Double.Parse(DataGridView3("預收款項", i).Value))
- TextBox19.Text = Val(TextBox19.Text) + Double.Parse(DataGridView3("訂單數量", i).Value) : TextBox4.Text = Val(TextBox4.Text) + Double.Parse(DataGridView3("銷售金額", i).Value)
- TextBox11.Text = Val(TextBox11.Text) + Double.Parse(DataGridView3("客戶付款", i).Value) : TextBox20.Text = Val(TextBox20.Text) + Double.Parse(DataGridView3("未收款項", i).Value)
- TextBox22.Text = Val(TextBox22.Text) + Double.Parse(DataGridView3("預收款項", i).Value) : TextBox23.Text = Val(TextBox23.Text) + Double.Parse(DataGridView3("成本金額", i).Value)
- TextBox25.Text = Val(TextBox25.Text) + Double.Parse(DataGridView3("利潤", i).Value) : TextBox27.Text = Val(TextBox27.Text) + Double.Parse(DataGridView3("實際收款", i).Value)
- Next
- TextBox34.Text = Val(TextBox19.Text) + Val(TextBox2.Text) : TextBox36.Text = Val(TextBox3.Text) + Val(TextBox4.Text) : TextBox35.Text = Val(TextBox5.Text) + Val(TextBox11.Text)
- TextBox33.Text = Val(TextBox9.Text) + Val(TextBox20.Text) : TextBox32.Text = Val(TextBox21.Text) + Val(TextBox22.Text) : TextBox31.Text = Val(TextBox24.Text) + Val(TextBox23.Text)
- TextBox30.Text = Val(TextBox26.Text) + Val(TextBox25.Text) : TextBox29.Text = Val(TextBox28.Text) + Val(TextBox27.Text) : TextBox37.Text = Val(TextBox32.Text) - Val(TextBox33.Text)
-
- If Val(TextBox28.Text) >= 0 Then : TextBox28.ForeColor = Color.Blue : Else : TextBox28.ForeColor = Color.Red : End If
- If Val(TextBox27.Text) >= 0 Then : TextBox27.ForeColor = Color.Blue : Else : TextBox27.ForeColor = Color.Red : End If
- If Val(TextBox29.Text) >= 0 Then : TextBox29.ForeColor = Color.Blue : Else : TextBox29.ForeColor = Color.Red : End If
- If Val(TextBox37.Text) >= 0 Then : TextBox37.ForeColor = Color.Blue : Else : TextBox37.ForeColor = Color.Red : End If
-
- TextBox2.Text = Strings.Format(Val(TextBox2.Text), "#,##0") : TextBox19.Text = Strings.Format(Val(TextBox19.Text), "#,##0") : TextBox34.Text = Strings.Format(Val(TextBox34.Text), "#,##0")
- TextBox3.Text = Strings.Format(Val(TextBox3.Text), "#,##0.00") : TextBox4.Text = Strings.Format(Val(TextBox4.Text), "#,##0.00") : TextBox36.Text = Strings.Format(Val(TextBox36.Text), "#,##0.00")
- TextBox5.Text = Strings.Format(Val(TextBox5.Text), "#,##0.00") : TextBox11.Text = Strings.Format(Val(TextBox11.Text), "#,##0.00") : TextBox35.Text = Strings.Format(Val(TextBox35.Text), "#,##0.00")
- TextBox9.Text = Strings.Format(Val(TextBox9.Text), "#,##0.00") : TextBox20.Text = Strings.Format(Val(TextBox20.Text), "#,##0.00") : TextBox33.Text = Strings.Format(Val(TextBox33.Text), "#,##0.00")
- TextBox21.Text = Strings.Format(Val(TextBox21.Text), "#,##0.00") : TextBox22.Text = Strings.Format(Val(TextBox22.Text), "#,##0.00") : TextBox32.Text = Strings.Format(Val(TextBox32.Text), "#,##0.00")
- TextBox24.Text = Strings.Format(Val(TextBox24.Text), "#,##0.00") : TextBox23.Text = Strings.Format(Val(TextBox23.Text), "#,##0.00") : TextBox31.Text = Strings.Format(Val(TextBox31.Text), "#,##0.00")
- TextBox26.Text = Strings.Format(Val(TextBox26.Text), "#,##0.00") : TextBox25.Text = Strings.Format(Val(TextBox25.Text), "#,##0.00") : TextBox30.Text = Strings.Format(Val(TextBox30.Text), "#,##0.00")
- TextBox28.Text = Strings.Format(Val(TextBox28.Text), "#,##0.00") : TextBox27.Text = Strings.Format(Val(TextBox27.Text), "#,##0.00") : TextBox29.Text = Strings.Format(Val(TextBox29.Text), "#,##0.00")
- TextBox37.Text = Strings.Format(Val(TextBox37.Text), "#,##0.00")
- End Sub
- Private Sub Set_格式()
- TextBox1.Enabled = False : TextBox12.Enabled = False : TextBox13.Enabled = False : TextBox14.Enabled = False : TextBox15.Enabled = False
- TextBox6.Visible = False : TextBox7.Visible = False : TextBox16.Visible = False : TextBox17.Visible = False : TextBox10.Visible = False : TextBox8.Visible = False
- Button6.Enabled = False : Timer1.Enabled = False : Label47.Visible = False : Button5.Enabled = True : Button9.Enabled = True
- Button11.Enabled = False : Button12.Enabled = False : Button13.Enabled = False
- End Sub
- Private Sub 訂單價格利潤明細表_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.MdiParent = WINPROFIT_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
- ComboBox1.Text = Year(Today) : ComboBox10.SelectedIndex = 0 : ComboBox2.SelectedIndex = 0
- BB(0) = True : BB(1) = False : BB(2) = False : BB(3) = False
- Button34.Enabled = False : TextBox18.Visible = False
- Set_訂單清單1() : Set_訂單清單2() : Set_grid() : Set_grid3() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
- End Sub
- Private Sub ComboBox10_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox10.TextChanged
- If ComboBox10.Text = "LANDED BRANDED" Then
- DataGridView1.Visible = True : DataGridView3.Visible = False
- Else
- DataGridView1.Visible = False : DataGridView3.Visible = True
- End If
- Set_未建檔清單() : Set_自動彙總1()
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- If Label47.Visible = True Then : Label47.Visible = False : Else : Label47.Visible = True : End If
- End Sub
- Private Sub DataGridView1_CellEndEdit(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit
- Set_自動彙總1()
- End Sub
- Private Sub DataGridView3_CellEndEdit(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView3.CellEndEdit
- Set_自動彙總1()
- End Sub
- Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
- If e.RowIndex = -1 Then : Else
- TextBox1.Text = DataGridView1("訂單流水號", e.RowIndex).Value.ToString : TextBox12.Text = DataGridView1("客戶訂單號", e.RowIndex).Value.ToString
- TextBox13.Text = DataGridView1("型體號碼", e.RowIndex).Value.ToString : TextBox14.Text = DataGridView1("顏色", e.RowIndex).Value.ToString
- TextBox15.Text = DataGridView1("楦型", e.RowIndex).Value.ToString : TextBox16.Text = DataGridView1("資料流水號", e.RowIndex).Value.ToString
- ComboBox1.Text = DataGridView1("年份", e.RowIndex).Value.ToString : ComboBox2.Text = DataGridView1("Currency", e.RowIndex).Value.ToString
- TextBox17.Text = DataGridView1("利潤表流水號", e.RowIndex).Value.ToString
- End If
- End Sub
- Private Sub DataGridView3_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView3.CellClick
- If e.RowIndex = -1 Then : Else
- TextBox1.Text = DataGridView3("訂單流水號", e.RowIndex).Value.ToString : TextBox12.Text = DataGridView3("客戶訂單號", e.RowIndex).Value.ToString
- TextBox13.Text = DataGridView3("型體號碼", e.RowIndex).Value.ToString : TextBox14.Text = DataGridView3("顏色", e.RowIndex).Value.ToString
- TextBox15.Text = DataGridView3("楦型", e.RowIndex).Value.ToString : TextBox16.Text = DataGridView3("資料流水號", e.RowIndex).Value.ToString
- ComboBox1.Text = DataGridView3("年份", e.RowIndex).Value.ToString : ComboBox2.Text = DataGridView3("Currency", e.RowIndex).Value.ToString
- TextBox17.Text = DataGridView3("利潤表流水號", e.RowIndex).Value.ToString
- End If
- End Sub
- Private Sub DataGridView2_CellClick(ByVal sender As Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView2.CellClick
- If e.RowIndex = -1 Then : Else
- TextBox1.Text = DataGridView2(0, e.RowIndex).Value.ToString
- Timer1.Enabled = True : Button6.Enabled = True : CheckBox1.Checked = True : CheckBox2.Checked = False : Button5.Enabled = False : Button9.Enabled = False
- Button11.Enabled = True : Button12.Enabled = True : Button13.Enabled = True
- Set_訂單清單1() : Set_訂單清單2()
- End If
- End Sub
- Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
- If CheckBox1.Checked = True Then
- If TextBox16.Text = "" Or TextBox1.Text = "" Then
- MsgBox("沒有選擇將要拆分的資料")
- Else
- Dim NUM2 As Integer
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "Select Top(1) 利潤表流水號 FROM 訂單價格利潤表暫存檔 ORDER BY 利潤表流水號 DESC"
- cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
- If dr.Read() Then : NUM2 = Strings.Right(dr("利潤表流水號").ToString, 8) : End If
- conn.Close()
- NUM2 += 1
- If NUM2 < 10 Then : WW = "PR" & "0000000" & NUM2
- ElseIf NUM2 > 9 And NUM2 < 100 Then : WW = "PR" & "000000" & NUM2
- ElseIf NUM2 > 99 And NUM2 < 1000 Then : WW = "PR" & "00000" & NUM2
- ElseIf NUM2 > 999 And NUM2 < 10000 Then : WW = "PR" & "0000" & NUM2
- ElseIf NUM2 > 9999 And NUM2 < 100000 Then : WW = "PR" & "000" & NUM2
- ElseIf NUM2 > 99999 And NUM2 < 100000 Then : WW = "PR" & "00" & NUM2
- ElseIf NUM2 > 999999 And NUM2 < 1000000 Then : WW = "PR" & "0" & NUM2
- ElseIf NUM2 > 9999999 Then : WW = "PR" & NUM2
- End If
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "INSERT INTO 訂單價格利潤表暫存檔 (資料流水號, 利潤表流水號, 訂單流水號) " &
- "VALUES ('" & TextBox16.Text & "','" & WW & "', '" & TextBox1.Text & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- Set_編輯清單1() : Set_編輯清單2() : Set_grid() : Set_grid3() : Set_自動彙總1()
- End If
- ElseIf CheckBox1.Checked = False Then
- Dim NUM2 As Integer
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT TOP (1) 利潤表流水號 FROM 訂單價格利潤明細表 ORDER BY 利潤表流水號 DESC"
- cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
- If dr.Read() Then : NUM2 = Strings.Right(dr("利潤表流水號").ToString, 8) : End If
- conn.Close()
- NUM2 += 1
- If NUM2 < 10 Then : WW = "PR" & "0000000" & NUM2
- ElseIf NUM2 > 9 And NUM2 < 100 Then : WW = "PR" & "000000" & NUM2
- ElseIf NUM2 > 99 And NUM2 < 1000 Then : WW = "PR" & "00000" & NUM2
- ElseIf NUM2 > 999 And NUM2 < 10000 Then : WW = "PR" & "0000" & NUM2
- ElseIf NUM2 > 9999 And NUM2 < 100000 Then : WW = "PR" & "000" & NUM2
- ElseIf NUM2 > 99999 And NUM2 < 100000 Then : WW = "PR" & "00" & NUM2
- ElseIf NUM2 > 999999 And NUM2 < 1000000 Then : WW = "PR" & "0" & NUM2
- ElseIf NUM2 > 9999999 Then : WW = "PR" & NUM2
- End If
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "INSERT INTO 訂單價格利潤明細表 (資料流水號, 訂單流水號, 客戶訂單號, 利潤表流水號, 年份, Quantity, Exchange, 審核, 類型, Price,
- Discount_price, Commercial_invoice, Overage_invoice, Selling_price, HTS_code, Remark1, Fty_price, Mold_cost,
- Collected_mold_cost, Amortization_qty, Profit, Commission, Remark2, Currency) " &
- "VALUES ('" & TextBox16.Text & "', '" & TextBox1.Text & "', '" & TextBox12.Text & "', '" & WW & "', '" & ComboBox1.Text & "', N'0', N'0', N'0', N'0', '" & ComboBox10.Text &
- "', N'0', N'0', N'0', N'0', N'0', N'', N'', N'0', N'0', N'0', N'0', N'0', N'0', N'', '" & ComboBox2.Text & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- Set_訂單清單1() : Set_訂單清單2() : Set_grid() : Set_grid3() : Set_自動彙總1()
- End If
- End Sub
- Private Sub Button15_Click(sender As Object, e As EventArgs) Handles Button15.Click
- If CheckBox1.Checked = True Then
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "DELETE FROM 訂單價格利潤表暫存檔 WHERE 利潤表流水號 LIKE '" & TextBox17.Text & "'"
- cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : cmd.ExecuteNonQuery() : conn.Close()
- Set_編輯清單1() : Set_編輯清單2() : Set_grid() : Set_grid3() : Set_自動彙總1()
- ElseIf CheckBox1.Checked = False Then
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "DELETE FROM 訂單價格利潤明細表 WHERE 利潤表流水號 LIKE '" & TextBox17.Text & "'"
- cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : cmd.ExecuteNonQuery() : conn.Close()
- Set_訂單清單1() : Set_訂單清單2() : Set_grid() : Set_grid3() : Set_自動彙總1()
- End If
- End Sub
- Private Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
- Dim linePen As New Pen(Color.Blue, 2)
- If e.RowIndex = DataGridView1.Rows.Count - 1 Then
- Exit Sub
- Else
- If DataGridView1(2, e.RowIndex).Value.ToString <> DataGridView1(2, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(DataGridView1.RowHeadersVisible, DataGridView1.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + DataGridView1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView1.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
- Exit Sub
- End If
- End If
- End Sub
- Private Sub DataGridView3_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView3.RowPostPaint
- Dim linePen As New Pen(Color.Blue, 2)
- If e.RowIndex = DataGridView3.Rows.Count - 1 Then
- Exit Sub
- Else
- If DataGridView3(2, e.RowIndex).Value.ToString <> DataGridView3(2, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(DataGridView3.RowHeadersVisible, DataGridView3.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + DataGridView3.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView3.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
- Exit Sub
- End If
- End If
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- PA = ""
- CheckBox1.Checked = False : CheckBox2.Checked = True : TextBox1.Text = ""
- Timer1.Enabled = False : Label47.Visible = False : Button6.Enabled = False : Button5.Enabled = True : Button9.Enabled = True
- Button11.Enabled = False : Button12.Enabled = False : Button13.Enabled = False
- Set_訂單清單1() : Set_訂單清單2() : Set_grid() : Set_grid3() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1()
- End Sub
- Private Sub Button34_Click(sender As Object, e As EventArgs) Handles Button34.Click
- Button34.Enabled = False : Button35.Enabled = True : Button2.Enabled = True
- BB(0) = True : BB(1) = False : BB(2) = False : BB(3) = False
- Set_grid() : Set_grid3()
- End Sub
- Private Sub Button35_Click(sender As Object, e As EventArgs) Handles Button35.Click
- Button34.Enabled = True : Button35.Enabled = False : Button2.Enabled = True
- BB(0) = False : BB(1) = True : BB(2) = False : BB(3) = False
- Set_grid() : Set_grid3()
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Button34.Enabled = True : Button35.Enabled = True : Button2.Enabled = False
- BB(0) = False : BB(1) = False : BB(2) = True : BB(3) = False
- Set_grid() : Set_grid3()
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- PA = InputBox("請輸入要查詢的資料") : TextBox1.Text = ""
- If ComboBox10.Text = "LANDED BRANDED" Then
- Set_訂單清單1() : Set_grid() : Set_自動彙總1()
- Else
- Set_訂單清單2() : Set_grid3() : Set_自動彙總1()
- End If
- End Sub
- Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.Click
- CheckBox1.Checked = True : CheckBox2.Checked = False
- End Sub
- Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.Click
- CheckBox1.Checked = False : CheckBox2.Checked = True
- End Sub
- Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
- Set_未建檔清單() : Set_grid1()
- End Sub
- Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
- If ComboBox1.Text = "" Or ComboBox2.Text = "" Then
- MsgBox("年份或幣別沒有選擇")
- Else
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : 進度條()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 利潤表流水號 FROM 訂單價格利潤明細表 WHERE (資料流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
- If dr.Read() Then
- conn.Close()
- Else
- conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "UPDATE 訂單控制表 SET 單價 = '" & DataGridView1.Rows(i).Cells("單價").Value & "', 總金額 = '" & DataGridView1.Rows(i).Cells("銷售金額").Value & "' " &
- "WHERE (資料流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
-
- SQL1 = "INSERT INTO 訂單價格利潤明細表 (資料流水號, 訂單流水號, 客戶訂單號, 利潤表流水號, 年份, Quantity, Exchange, 審核, 類型, Price,
- Discount_price, Commercial_invoice, Overage_invoice, Selling_price, HTS_code, Remark1, Fty_price, Mold_cost,
- Collected_mold_cost, Amortization_qty, Profit, Commission, Remark2, Currency) " &
- "VALUES ('" & DataGridView1.Rows(i).Cells("資料流水號").Value & "', '" & DataGridView1.Rows(i).Cells("訂單流水號").Value &
- "', '" & DataGridView1.Rows(i).Cells("客戶訂單號").Value & "', '" & DataGridView1.Rows(i).Cells("利潤表流水號").Value &
- "', '" & ComboBox1.Text & "', '" & DataGridView1.Rows(i).Cells("Quantity").Value &
- "', '" & DataGridView1.Rows(i).Cells("Exchange").Value & "', '" & DataGridView1.Rows(i).Cells("審核").Value & "', '" & ComboBox10.Text &
- "', '" & DataGridView1.Rows(i).Cells("Price").Value & "', '" & DataGridView1.Rows(i).Cells("Discount price").Value &
- "', '" & DataGridView1.Rows(i).Cells("Commercial invoice").Value & "', '" & DataGridView1.Rows(i).Cells("Overage invoice").Value &
- "', '" & DataGridView1.Rows(i).Cells("Selling price").Value & "', '" & DataGridView1.Rows(i).Cells("HTS code").Value &
- "', '" & DataGridView1.Rows(i).Cells("Remark1").Value & "', '" & DataGridView1.Rows(i).Cells("Fty price").Value &
- "', '" & DataGridView1.Rows(i).Cells("Mold cost").Value & "', '" & DataGridView1.Rows(i).Cells("Collected mold cost").Value &
- "', '" & DataGridView1.Rows(i).Cells("Amortization qty").Value & "', '" & DataGridView1.Rows(i).Cells("Profit").Value &
- "', '" & DataGridView1.Rows(i).Cells("Commission").Value & "', '" & DataGridView1.Rows(i).Cells("Remark2").Value & "', '" & ComboBox2.Text & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- End If
- Next i : ProgressBar1.Value = 0 : 最終數 = 0
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1
- 資料數 = DataGridView3.Rows.Count : 進度條()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 利潤表流水號 FROM 訂單價格利潤明細表 WHERE (資料流水號 LIKE '" & DataGridView3.Rows(i).Cells("資料流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
- If dr.Read() Then
- conn.Close()
- Else
- conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "UPDATE 訂單控制表 SET 單價 = '" & DataGridView3.Rows(i).Cells("單價").Value & "', 總金額 = '" & DataGridView3.Rows(i).Cells("銷售金額").Value & "' " &
- "WHERE (資料流水號 LIKE '" & DataGridView3.Rows(i).Cells("資料流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
-
- SQL1 = "INSERT INTO 訂單價格利潤明細表 (資料流水號, 訂單流水號, 客戶訂單號, 利潤表流水號, 年份, Quantity, Exchange, 審核, 類型, Price,
- Discount_price, Commercial_invoice, Overage_invoice, Selling_price, HTS_code, Remark1, Fty_price, Mold_cost,
- Collected_mold_cost, Amortization_qty, Profit, Commission, Remark2, Currency) " &
- "VALUES ('" & DataGridView3.Rows(i).Cells("資料流水號").Value & "', '" & DataGridView3.Rows(i).Cells("訂單流水號").Value &
- "', '" & DataGridView3.Rows(i).Cells("客戶訂單號").Value & "', '" & DataGridView3.Rows(i).Cells("利潤表流水號").Value &
- "', '" & ComboBox1.Text & "', '" & DataGridView3.Rows(i).Cells("Quantity").Value &
- "', '" & DataGridView3.Rows(i).Cells("Exchange").Value & "', '" & DataGridView3.Rows(i).Cells("審核").Value & "', '" & ComboBox10.Text &
- "', '" & DataGridView3.Rows(i).Cells("Price").Value & "', '" & DataGridView3.Rows(i).Cells("Discount price").Value &
- "', '" & DataGridView3.Rows(i).Cells("Commercial invoice").Value & "', '" & DataGridView3.Rows(i).Cells("Overage invoice").Value &
- "', '" & DataGridView3.Rows(i).Cells("Selling price").Value & "', '" & DataGridView3.Rows(i).Cells("HTS code").Value &
- "', '" & DataGridView3.Rows(i).Cells("Remark1").Value & "', '" & DataGridView3.Rows(i).Cells("Fty price").Value &
- "', '" & DataGridView3.Rows(i).Cells("Mold cost").Value & "', '" & DataGridView3.Rows(i).Cells("Collected mold cost").Value &
- "', '" & DataGridView3.Rows(i).Cells("Amortization qty").Value & "', '" & DataGridView3.Rows(i).Cells("Profit").Value &
- "', '" & DataGridView3.Rows(i).Cells("Commission").Value & "', '" & DataGridView3.Rows(i).Cells("Remark2").Value & "', '" & ComboBox2.Text & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- End If
- Next i : ProgressBar1.Value = 0 : 最終數 = 0
- End If
- MsgBox("存檔完成")
- CheckBox1.Checked = False : CheckBox2.Checked = True
- Set_訂單清單1() : Set_訂單清單2() : Set_grid() : Set_grid3() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
- End If
- End Sub
- Private Sub 進度條()
- 平均數 = 10000 / 資料數
- 最終數 += 平均數
- If 最終數 > 10000 Then : 最終數 = 10000 : End If
- ProgressBar1.Value = 最終數
- End Sub
- Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
- If ComboBox1.Text = "" Or ComboBox2.Text = "" Then
- MsgBox("年份或幣別沒有選擇")
- Else
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : 進度條()
- conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "UPDATE 訂單控制表 SET 單價 = '" & DataGridView1.Rows(i).Cells("單價").Value & "', 總金額 = '" & DataGridView1.Rows(i).Cells("銷售金額").Value & "' " &
- "WHERE (資料流水號 LIKE '" & DataGridView1.Rows(i).Cells("資料流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "UPDATE 訂單價格利潤明細表 SET 年份 = '" & DataGridView1.Rows(i).Cells("年份").Value & "', Quantity = '" & DataGridView1.Rows(i).Cells("Quantity").Value &
- "', Exchange = '" & DataGridView1.Rows(i).Cells("Exchange").Value & "', 審核 = '" & DataGridView1.Rows(i).Cells("審核").Value &
- "', Price = '" & DataGridView1.Rows(i).Cells("Price").Value & "', Discount_price = '" & DataGridView1.Rows(i).Cells("Discount price").Value &
- "', Commercial_invoice = '" & DataGridView1.Rows(i).Cells("Commercial invoice").Value &
- "', Overage_invoice = '" & DataGridView1.Rows(i).Cells("Overage invoice").Value &
- "', Selling_price = '" & DataGridView1.Rows(i).Cells("Selling price").Value & "', HTS_code = '" & DataGridView1.Rows(i).Cells("HTS code").Value &
- "', Remark1 = '" & DataGridView1.Rows(i).Cells("Remark1").Value & "', Fty_price = '" & DataGridView1.Rows(i).Cells("Fty price").Value &
- "', Mold_cost = '" & DataGridView1.Rows(i).Cells("Mold cost").Value &
- "', Collected_mold_cost = '" & DataGridView1.Rows(i).Cells("Collected mold cost").Value &
- "', Amortization_qty = '" & DataGridView1.Rows(i).Cells("Amortization qty").Value & "' , Profit = '" & DataGridView1.Rows(i).Cells("Profit").Value &
- "', Commission = '" & DataGridView1.Rows(i).Cells("Commission").Value & "', Remark2 = '" & DataGridView1.Rows(i).Cells("Remark2").Value &
- "', Currency = '" & ComboBox2.Text & "'
- WHERE (利潤表流水號 LIKE '" & DataGridView1.Rows(i).Cells("利潤表流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- TextBox18.Text = Strings.Format(Val((i / (DataGridView1.Rows.Count - 1)) * 100), "#,##0.0") & "%"
- Next i : ProgressBar1.Value = 0 : 最終數 = 0
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1
- 資料數 = DataGridView3.Rows.Count : 進度條()
- conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "UPDATE 訂單控制表 SET 單價 = '" & DataGridView3.Rows(i).Cells("單價").Value & "', 總金額 = '" & DataGridView3.Rows(i).Cells("銷售金額").Value & "' " &
- "WHERE (資料流水號 LIKE '" & DataGridView3.Rows(i).Cells("資料流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "UPDATE 訂單價格利潤明細表 SET 年份 = '" & DataGridView3.Rows(i).Cells("年份").Value & "', Quantity = '" & DataGridView3.Rows(i).Cells("Quantity").Value &
- "', Exchange = '" & DataGridView3.Rows(i).Cells("Exchange").Value & "', 審核 = '" & DataGridView3.Rows(i).Cells("審核").Value &
- "', Price = '" & DataGridView3.Rows(i).Cells("Price").Value & "', Discount_price = '" & DataGridView3.Rows(i).Cells("Discount price").Value &
- "', Commercial_invoice = '" & DataGridView3.Rows(i).Cells("Commercial invoice").Value &
- "', Overage_invoice = '" & DataGridView3.Rows(i).Cells("Overage invoice").Value &
- "', Selling_price = '" & DataGridView3.Rows(i).Cells("Selling price").Value & "', HTS_code = '" & DataGridView3.Rows(i).Cells("HTS code").Value &
- "', Remark1 = '" & DataGridView3.Rows(i).Cells("Remark1").Value & "', Fty_price = '" & DataGridView3.Rows(i).Cells("Fty price").Value &
- "', Mold_cost = '" & DataGridView3.Rows(i).Cells("Mold cost").Value &
- "', Collected_mold_cost = '" & DataGridView3.Rows(i).Cells("Collected mold cost").Value &
- "', Amortization_qty = '" & DataGridView3.Rows(i).Cells("Amortization qty").Value & "' , Profit = '" & DataGridView3.Rows(i).Cells("Profit").Value &
- "', Commission = '" & DataGridView3.Rows(i).Cells("Commission").Value & "', Remark2 = '" & DataGridView3.Rows(i).Cells("Remark2").Value &
- "', Currency = '" & ComboBox2.Text & "'
- WHERE (利潤表流水號 LIKE '" & DataGridView3.Rows(i).Cells("利潤表流水號").Value & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- TextBox18.Text = Strings.Format(Val((i / (DataGridView3.Rows.Count - 1)) * 100), "#,##0.0") & "%"
- Next i : ProgressBar1.Value = 0 : 最終數 = 0
-
- End If
- MsgBox("修改完成")
- CheckBox1.Checked = False : CheckBox2.Checked = True
- Set_訂單清單1() : Set_訂單清單2() : Set_grid() : Set_grid3() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
- End If
- End Sub
- Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
- If TextBox1.Text = "" Then
- MsgBox("請選擇要刪除的資料")
- Else
- Dim aa As MsgBoxResult
- aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
- If aa = MsgBoxResult.Ok Then
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "UPDATE 訂單控制表 SET 單價 = '0.00', 總金額 = '0.00' " &
- "WHERE (訂單流水號 LIKE '" & TextBox1.Text & "')"
- cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "DELETE FROM 訂單價格利潤明細表 WHERE (訂單流水號 = '" & TextBox1.Text & "')"
- cmd.CommandText = SQL1 : cmd.Connection = conn : cmd.ExecuteNonQuery() : cmd.ExecuteNonQuery() : conn.Close()
- MsgBox("刪除完成")
- End If
- End If
- Set_訂單清單1() : Set_訂單清單2() : Set_grid() : Set_grid3() : Set_未建檔清單() : Set_grid1() : Set_自動彙總1() : Set_格式()
- End Sub
- Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1 : DataGridView1.Rows(i).Cells("Quantity").Value = 0 : Next i
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1 : DataGridView3.Rows(i).Cells("Quantity").Value = 0 : Next i
- End If
- End Sub
- Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1 : DataGridView1.Rows(i).Cells("Quantity").Value = DataGridView1.Rows(i).Cells("訂單數量").Value : Next i
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1 : DataGridView3.Rows(i).Cells("Quantity").Value = DataGridView3.Rows(i).Cells("訂單數量").Value : Next i
- End If
- End Sub
- Private Sub Button13_Click(sender As Object, e As EventArgs) Handles Button13.Click
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1 : DataGridView1.Rows(i).Cells("Exchange").Value = 1 : Next i
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1 : DataGridView3.Rows(i).Cells("Exchange").Value = 1 : Next i
- End If
- End Sub
- Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1 : DataGridView1.Rows(i).Cells("Currency").Value = ComboBox2.Text : Next i
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1 : DataGridView3.Rows(i).Cells("Currency").Value = ComboBox2.Text : Next i
- End If
- End Sub
- Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
- If ComboBox10.Text = "LANDED BRANDED" Then
- For i As Integer = 0 To DataGridView1.Rows.Count - 1 : DataGridView1.Rows(i).Cells("年份").Value = ComboBox1.Text : Next i
- Else
- For i As Integer = 0 To DataGridView3.Rows.Count - 1 : DataGridView3.Rows(i).Cells("年份").Value = ComboBox1.Text : Next i
- End If
- End Sub
- Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
- If 列印用SQL = "" Then : MsgBox("請先搜尋資料後再行列印")
- Else
- xlApp = CType(CreateObject("Excel.Application"), Application)
- xlBook = xlApp.Workbooks.Add
- xlApp.DisplayAlerts = True
- xlApp.Visible = True
- xlApp.Application.WindowState = xlMaximized
-
- xlSheet = NewMethod(xlBook)
- xlApp.Sheets(1).Name = "FIRST COST"
- xlBook.Activate() : xlSheet.Activate()
-
- xlSheet.Cells(3, 1) = "BUYER" : xlSheet.Cells(3, 7) = "顏色" : xlSheet.Cells(3, 13) = "銷售金額" : xlSheet.Cells(3, 19) = "Remark1" : xlSheet.Cells(3, 25) = "Commission"
- xlSheet.Cells(3, 2) = "年份季度" : xlSheet.Cells(3, 8) = "楦型" : xlSheet.Cells(3, 14) = "備註" : xlSheet.Cells(3, 20) = "Fty price" : xlSheet.Cells(3, 26) = "Remark2"
- xlSheet.Cells(3, 3) = "訂單流水號" : xlSheet.Cells(3, 9) = "訂單數量" : xlSheet.Cells(3, 15) = "Price" : xlSheet.Cells(3, 21) = "Mold cost" : xlSheet.Cells(3, 27) = "客戶付款"
- xlSheet.Cells(3, 4) = "客戶訂單號" : xlSheet.Cells(3, 10) = "交期開始" : xlSheet.Cells(3, 16) = "Discount price" : xlSheet.Cells(3, 22) = "Collected mold cost" : xlSheet.Cells(3, 28) = "預收款項"
- xlSheet.Cells(3, 5) = "型體號碼" : xlSheet.Cells(3, 11) = "交期結束" : xlSheet.Cells(3, 17) = "Selling price" : xlSheet.Cells(3, 23) = "Amortization qty" : xlSheet.Cells(3, 29) = "成本金額"
- xlSheet.Cells(3, 6) = "型體名稱" : xlSheet.Cells(3, 12) = "單價" : xlSheet.Cells(3, 18) = "HTS code" : xlSheet.Cells(3, 24) = "Profit" : xlSheet.Cells(3, 30) = "利潤"
- xlSheet.Cells(1, 8) = "Total-PRS" : xlSheet.Cells(2, 8) = "=SUBTOTAL(9,I4:I$99999)" : xlSheet.Cells(1, 24) = "Total-Commission" : xlSheet.Cells(2, 24) = "=SUBTOTAL(9,Y4:Y$99999)"
- xlSheet.Cells(3, 31) = "實際收款" : xlSheet.Cells(3, 32) = "Currency" : xlSheet.Cells(3, 33) = "Exchange" : xlSheet.Cells(3, 34) = "年份" : xlSheet.Cells(1, 26) = "合計"
- xlSheet.Cells(1, 27) = "=SUBTOTAL(9,AA4:AA$99999)" : xlSheet.Cells(1, 28) = "=SUBTOTAL(9,AB4:AB$99999)" : xlSheet.Cells(1, 29) = "=SUBTOTAL(9,AC4:AC$99999)"
- xlSheet.Cells(1, 30) = "=SUBTOTAL(9,AD4:AD$99999)" : xlSheet.Cells(1, 31) = "=SUBTOTAL(9,AE4:AE$99999)" : xlSheet.Cells(1, 1) = "FIRST COST"
- For i As Integer = 0 To DataGridView3.Rows.Count - 1
- xlSheet.Cells(i + 4, 1) = DataGridView3.Rows(i).Cells("BUYER").Value : xlSheet.Cells(i + 4, 2) = DataGridView3.Rows(i).Cells("年份季度").Value
- xlSheet.Cells(i + 4, 3) = DataGridView3.Rows(i).Cells("訂單流水號").Value : xlSheet.Cells(i + 4, 4) = DataGridView3.Rows(i).Cells("客戶訂單號").Value
- xlSheet.Cells(i + 4, 5) = DataGridView3.Rows(i).Cells("型體號碼").Value : xlSheet.Cells(i + 4, 6) = DataGridView3.Rows(i).Cells("型體名稱").Value
- xlSheet.Cells(i + 4, 7) = DataGridView3.Rows(i).Cells("顏色").Value : xlSheet.Cells(i + 4, 8) = DataGridView3.Rows(i).Cells("楦型").Value
- xlSheet.Cells(i + 4, 9) = DataGridView3.Rows(i).Cells("訂單數量").Value : xlSheet.Cells(i + 4, 10) = DataGridView3.Rows(i).Cells("交期開始").Value
- xlSheet.Cells(i + 4, 11) = DataGridView3.Rows(i).Cells("交期結束").Value : xlSheet.Cells(i + 4, 12) = DataGridView3.Rows(i).Cells("單價").Value
- xlSheet.Cells(i + 4, 13) = DataGridView3.Rows(i).Cells("銷售金額").Value : xlSheet.Cells(i + 4, 14) = DataGridView3.Rows(i).Cells("備註").Value
- xlSheet.Cells(i + 4, 15) = DataGridView3.Rows(i).Cells("Price").Value : xlSheet.Cells(i + 4, 16) = DataGridView3.Rows(i).Cells("Discount price").Value
- xlSheet.Cells(i + 4, 17) = DataGridView3.Rows(i).Cells("Selling price").Value : xlSheet.Cells(i + 4, 18) = DataGridView3.Rows(i).Cells("HTS code").Value
- xlSheet.Cells(i + 4, 19) = DataGridView3.Rows(i).Cells("Remark1").Value : xlSheet.Cells(i + 4, 20) = DataGridView3.Rows(i).Cells("Fty price").Value
- xlSheet.Cells(i + 4, 21) = DataGridView3.Rows(i).Cells("Mold cost").Value : xlSheet.Cells(i + 4, 22) = "=U" & i + 4 & "*I" & i + 4
- xlSheet.Cells(i + 4, 23) = DataGridView3.Rows(i).Cells("Amortization qty").Value
- xlSheet.Cells(i + 4, 24) = "=IF((P" & i + 4 & "-U" & i + 4 & ")=0,0,(P" & i + 4 & "-T" & i + 4 & "-U" & i + 4 & ")/(P" & i + 4 & "-U" & i + 4 & "))"
- xlSheet.Cells(i + 4, 25) = "=(P" & i + 4 & "-T" & i + 4 & "-U" & i + 4 & ")*I" & i + 4 : xlSheet.Cells(i + 4, 26) = DataGridView3.Rows(i).Cells("Remark2").Value
- xlSheet.Cells(i + 4, 27) = "=Q" & i + 4 & "*I" & i + 4 : xlSheet.Cells(i + 4, 28) = "=(Q" & i + 4 & "-P" & i + 4 & ")*I" & i + 4
- xlSheet.Cells(i + 4, 29) = "=(T" & i + 4 & "+U" & i + 4 & ")*I" & i + 4 : xlSheet.Cells(i + 4, 30) = "=M" & i + 4 & "-AC" & i + 4
- xlSheet.Cells(i + 4, 31) = "=AA" & i + 4 & "-AC" & i + 4 : xlSheet.Cells(i + 4, 32) = DataGridView3.Rows(i).Cells("Currency").Value
- xlSheet.Cells(i + 4, 33) = DataGridView3.Rows(i).Cells("Exchange").Value : xlSheet.Cells(i + 4, 34) = DataGridView3.Rows(i).Cells("年份").Value
- N1 = i
- Next i
- CC(xlApp, xlSheet)
-
- xlSheet = NewMethod(xlBook)
- xlApp.Sheets(1).Name = "LANDED BRANDED"
- xlBook.Activate() : xlSheet.Activate()
-
- xlSheet.Cells(3, 1) = "BUYER" : xlSheet.Cells(3, 7) = "顏色" : xlSheet.Cells(3, 13) = "銷售金額" : xlSheet.Cells(3, 19) = "Remark1" : xlSheet.Cells(3, 25) = "Commission"
- xlSheet.Cells(3, 2) = "年份季度" : xlSheet.Cells(3, 8) = "楦型" : xlSheet.Cells(3, 14) = "備註" : xlSheet.Cells(3, 20) = "Fty price" : xlSheet.Cells(3, 26) = "Remark2"
- xlSheet.Cells(3, 3) = "訂單流水號" : xlSheet.Cells(3, 9) = "訂單數量" : xlSheet.Cells(3, 15) = "Price" : xlSheet.Cells(3, 21) = "Mold cost" : xlSheet.Cells(3, 27) = "客戶付款"
- xlSheet.Cells(3, 4) = "客戶訂單號" : xlSheet.Cells(3, 10) = "交期開始" : xlSheet.Cells(3, 16) = "Discount price" : xlSheet.Cells(3, 22) = "Collected mold cost" : xlSheet.Cells(3, 28) = "未收款項"
- xlSheet.Cells(3, 5) = "型體號碼" : xlSheet.Cells(3, 11) = "交期結束" : xlSheet.Cells(3, 17) = "Commercial invoice" : xlSheet.Cells(3, 23) = "Amortization qty" : xlSheet.Cells(3, 29) = "成本金額"
- xlSheet.Cells(3, 6) = "型體名稱" : xlSheet.Cells(3, 12) = "單價" : xlSheet.Cells(3, 18) = "Overage invoice" : xlSheet.Cells(3, 24) = "Profit" : xlSheet.Cells(3, 30) = "利潤"
- xlSheet.Cells(1, 8) = "Total-PRS" : xlSheet.Cells(2, 8) = "=SUBTOTAL(9,I4:I$99999)" : xlSheet.Cells(1, 24) = "Total-Commission" : xlSheet.Cells(2, 24) = "=SUBTOTAL(9,Y4:Y$99999)"
- xlSheet.Cells(3, 31) = "實際收款" : xlSheet.Cells(3, 32) = "Currency" : xlSheet.Cells(3, 33) = "Exchange" : xlSheet.Cells(3, 34) = "年份" : xlSheet.Cells(1, 26) = "合計"
- xlSheet.Cells(1, 27) = "=SUBTOTAL(9,AA4:AA$99999)" : xlSheet.Cells(1, 28) = "=SUBTOTAL(9,AB4:AB$99999)" : xlSheet.Cells(1, 29) = "=SUBTOTAL(9,AC4:AC$99999)"
- xlSheet.Cells(1, 30) = "=SUBTOTAL(9,AD4:AD$99999)" : xlSheet.Cells(1, 31) = "=SUBTOTAL(9,AE4:AE$99999)" : xlSheet.Cells(1, 1) = "LANDED BRANDED"
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- xlSheet.Cells(i + 4, 1) = DataGridView1.Rows(i).Cells("BUYER").Value : xlSheet.Cells(i + 4, 2) = DataGridView1.Rows(i).Cells("年份季度").Value
- xlSheet.Cells(i + 4, 3) = DataGridView1.Rows(i).Cells("訂單流水號").Value : xlSheet.Cells(i + 4, 4) = DataGridView1.Rows(i).Cells("客戶訂單號").Value
- xlSheet.Cells(i + 4, 5) = DataGridView1.Rows(i).Cells("型體號碼").Value : xlSheet.Cells(i + 4, 6) = DataGridView1.Rows(i).Cells("型體名稱").Value
- xlSheet.Cells(i + 4, 7) = DataGridView1.Rows(i).Cells("顏色").Value : xlSheet.Cells(i + 4, 8) = DataGridView1.Rows(i).Cells("楦型").Value
- xlSheet.Cells(i + 4, 9) = DataGridView1.Rows(i).Cells("訂單數量").Value : xlSheet.Cells(i + 4, 10) = DataGridView1.Rows(i).Cells("交期開始").Value
- xlSheet.Cells(i + 4, 11) = DataGridView1.Rows(i).Cells("交期結束").Value : xlSheet.Cells(i + 4, 12) = DataGridView1.Rows(i).Cells("單價").Value
- xlSheet.Cells(i + 4, 13) = DataGridView1.Rows(i).Cells("銷售金額").Value : xlSheet.Cells(i + 4, 14) = DataGridView1.Rows(i).Cells("備註").Value
- xlSheet.Cells(i + 4, 15) = DataGridView1.Rows(i).Cells("Price").Value : xlSheet.Cells(i + 4, 16) = DataGridView1.Rows(i).Cells("Discount price").Value
- xlSheet.Cells(i + 4, 17) = DataGridView1.Rows(i).Cells("Commercial invoice").Value : xlSheet.Cells(i + 4, 18) = DataGridView1.Rows(i).Cells("Overage invoice").Value
- xlSheet.Cells(i + 4, 19) = DataGridView1.Rows(i).Cells("Remark1").Value : xlSheet.Cells(i + 4, 20) = DataGridView1.Rows(i).Cells("Fty price").Value
- xlSheet.Cells(i + 4, 21) = DataGridView1.Rows(i).Cells("Mold cost").Value : xlSheet.Cells(i + 4, 22) = "=U" & i + 4 & "*I" & i + 4
- xlSheet.Cells(i + 4, 23) = DataGridView1.Rows(i).Cells("Amortization qty").Value
- xlSheet.Cells(i + 4, 24) = "=IF((P" & i + 4 & "-U" & i + 4 & ")=0,0,(P" & i + 4 & "-T" & i + 4 & "-U" & i + 4 & ")/(P" & i + 4 & "-U" & i + 4 & "))"
- xlSheet.Cells(i + 4, 25) = "=(P" & i + 4 & "-T" & i + 4 & "-U" & i + 4 & ")*I" & i + 4 : xlSheet.Cells(i + 4, 26) = DataGridView1.Rows(i).Cells("Remark2").Value
- xlSheet.Cells(i + 4, 27) = "=Q" & i + 4 & "*I" & i + 4 : xlSheet.Cells(i + 4, 28) = "=R" & i + 4 & "*I" & i + 4
- xlSheet.Cells(i + 4, 29) = "=(T" & i + 4 & "+U" & i + 4 & ")*I" & i + 4 : xlSheet.Cells(i + 4, 30) = "=M" & i + 4 & "-AC" & i + 4
- xlSheet.Cells(i + 4, 31) = "=AA" & i + 4 & "-AC" & i + 4 : xlSheet.Cells(i + 4, 32) = DataGridView1.Rows(i).Cells("Currency").Value
- xlSheet.Cells(i + 4, 33) = DataGridView1.Rows(i).Cells("Exchange").Value : xlSheet.Cells(i + 4, 34) = DataGridView1.Rows(i).Cells("年份").Value
- N1 = i
- Next i
- CC(xlApp, xlSheet)
-
- xlSheet = NewMethod(xlBook)
- xlApp.Sheets(1).Name = "彙總"
- xlBook.Activate() : xlSheet.Activate()
-
- xlSheet.Cells(2, 1) = "ORDER SUMMARY DATA COLLECTION"
- xlSheet.Cells(3, 2) = "平均單價" '
- xlSheet.Cells(3, 3) = "總雙數" : xlSheet.Cells(3, 4) = "銷售金額" : xlSheet.Cells(3, 5) = "客戶付款" : xlSheet.Cells(3, 6) = "未收款項"
- xlSheet.Cells(3, 7) = "預收款項" : xlSheet.Cells(3, 8) = "成本金額" : xlSheet.Cells(3, 9) = "利潤" : xlSheet.Cells(3, 10) = "實際收款"
- xlSheet.Cells(4, 1) = "LANDED BRANDED" : xlSheet.Cells(4, 2) = "=D4/C4"
- xlSheet.Cells(4, 3) = TextBox2.Text : xlSheet.Cells(4, 4) = TextBox3.Text : xlSheet.Cells(4, 5) = TextBox5.Text : xlSheet.Cells(4, 6) = TextBox9.Text
- xlSheet.Cells(4, 7) = TextBox21.Text : xlSheet.Cells(4, 8) = TextBox24.Text : xlSheet.Cells(4, 9) = TextBox26.Text : xlSheet.Cells(4, 10) = TextBox28.Text
- xlSheet.Cells(5, 1) = "FIRST COST" : xlSheet.Cells(5, 2) = "=D5/C5"
- xlSheet.Cells(5, 3) = TextBox19.Text : xlSheet.Cells(5, 4) = TextBox4.Text : xlSheet.Cells(5, 5) = TextBox11.Text : xlSheet.Cells(5, 6) = TextBox20.Text
- xlSheet.Cells(5, 7) = TextBox22.Text : xlSheet.Cells(5, 8) = TextBox23.Text : xlSheet.Cells(5, 9) = TextBox25.Text : xlSheet.Cells(5, 10) = TextBox27.Text
- xlSheet.Cells(6, 1) = "合 計" : xlSheet.Cells(6, 2) = "=D6/C6"
- xlSheet.Cells(6, 3) = TextBox34.Text : xlSheet.Cells(6, 4) = TextBox36.Text : xlSheet.Cells(6, 5) = TextBox35.Text : xlSheet.Cells(6, 6) = TextBox33.Text
- xlSheet.Cells(6, 7) = TextBox32.Text : xlSheet.Cells(6, 8) = TextBox31.Text : xlSheet.Cells(6, 9) = TextBox30.Text : xlSheet.Cells(7, 10) = TextBox29.Text
- xlSheet.Cells(7, 6) = "PS : 應收應付如果 = 正數,及為應付;如果 = 負數,及惟應收。 預收款項 - 未收款項 = 應收應付"
- xlSheet.Cells(7, 9) = "利潤 + 應收應付 = 總實際收款" : xlSheet.Cells(7, 7) = TextBox37.Text
- AA(xlApp, xlSheet)
- xlSheet.PageSetup.PrintArea = ""
- xlApp.Cells.Select()
- xlSheet.Range("B1").Select()
- xlApp.Application.WindowState = xlMinimized
- MsgBox("列印完成")
- End If
- End Sub
- Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
- Return CType(xlBook.Worksheets.Add, Worksheet)
- End Function
- Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- xlSheet.Cells.Select()
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone
- End With
- xlSheet.Rows("2:7").Select : myExcel.Selection.RowHeight = 35
- xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 20
- xlSheet.Columns("B:J").Select : myExcel.Selection.ColumnWidth = 18
-
- xlSheet.Range("A2:J2").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
- End With : myExcel.Selection.Merge
-
- xlSheet.Range("B4:J6").Select() : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Range("G7").Select() : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Range("J7").Select() : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
-
- xlSheet.Range("I7").Select()
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
- End With
-
- xlSheet.Range("F7").Select()
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 1
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
- End With
-
- xlSheet.Range("A3:J3").Select()
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
- End With
-
- xlSheet.Range("A2:J6").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- myExcel.ActiveWindow.DisplayGridlines = False
-
- xlSheet.Range("C4:C6").Select() : myExcel.Selection.NumberFormatLocal = "#,##0;[紅色]-#,##0"
-
- xlSheet.Range("B3:J3").Select()
- With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent5 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
-
- xlSheet.Range("A4:A6").Select()
- With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorAccent4 : .TintAndShade = 0.799981688894314 : .PatternTintAndShade = 0 : End With
- End Sub
- Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- myExcel.ActiveWindow.Zoom = 90
- xlSheet.Cells.Select()
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 10 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone
- End With
- myExcel.Application.CutCopyMode = False
- xlSheet.Columns("D:D").Select : myExcel.Selection.NumberFormatLocal = "@"
- xlSheet.Columns("I:I").Select : myExcel.Selection.NumberFormatLocal = "#,##0;[紅色]-#,##0"
- xlSheet.Columns("J:K").Select : myExcel.Selection.NumberFormatLocal = "yyyy/mm/dd"
- xlSheet.Columns("L:L").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Columns("M:M").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Columns("O:R").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Columns("T:V").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Columns("W:W").Select : myExcel.Selection.NumberFormatLocal = "#,##0;[紅色]-#,##0"
- xlSheet.Columns("X:X").Select : myExcel.Selection.NumberFormatLocal = "0.00%"
- xlSheet.Columns("Y:Y").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Columns("AA:AE").Select : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
- xlSheet.Columns("AG:AG").Select : myExcel.Selection.NumberFormatLocal = "#,##0.0000;[紅色]-#,##0.0000"
- xlSheet.Columns("AF:AH").Select
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
- End With
-
- xlSheet.Rows("3:3").Select
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
- End With
- xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 18
- xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 12
- xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 16
- xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 12
- xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 13
- xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 12
- xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 20
- xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 5
- xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 8
- xlSheet.Columns("J:K").Select : myExcel.Selection.ColumnWidth = 9.5
- xlSheet.Columns("L:L").Select : myExcel.Selection.ColumnWidth = 6
- xlSheet.Columns("M:M").Select : myExcel.Selection.ColumnWidth = 12
- xlSheet.Columns("N:N").Select : myExcel.Selection.ColumnWidth = 20
- xlSheet.Columns("O:R").Select : xlSheet.Columns("O:R").EntireColumn.AutoFit
- xlSheet.Columns("T:Y").Select : xlSheet.Columns("T:Y").EntireColumn.AutoFit
- xlSheet.Columns("AA:AH").Select : xlSheet.Columns("AA:AH").EntireColumn.AutoFit
-
- xlSheet.Rows("4:4").Select : myExcel.ActiveWindow.FreezePanes = True : myExcel.ActiveWindow.DisplayGridlines = False
-
- xlSheet.Range("A3:AH" & N1 + 5).Select() : myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
-
- xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 45
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlTop : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False
- End With : myExcel.Selection.AutoFilter
-
- xlSheet.Range("H1:I1").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
-
- xlSheet.Range("H2:I2").Select()
- myExcel.Selection.Merge
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
-
- xlSheet.Range("H1:I2").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
-
- xlSheet.Range("A1:N3").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
-
- xlSheet.Range("A1:N3").Select()
- With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .ThemeColor = xlThemeColorDark1 : .TintAndShade = -0.249977111117893 : .PatternTintAndShade = 0 : End With
-
- xlSheet.Range("X1:Y1").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
-
- xlSheet.Range("X2:Y2").Select()
- myExcel.Selection.Merge
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
-
- xlSheet.Range("Z1:Z2").Select()
- myExcel.Selection.Merge
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
-
- xlSheet.Range("AA1:AA2").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
-
- xlSheet.Range("AB1:AB2").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
-
- xlSheet.Range("AC1:AC2").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
-
- xlSheet.Range("AD1:AD2").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
-
- xlSheet.Range("AE1:AE2").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
-
- xlSheet.Range("O1:Z3").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 65535 : .TintAndShade = 0 : .PatternTintAndShade = 0 : End With
-
- xlSheet.Range("AA1:AE3").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Interior : .Pattern = xlSolid : .PatternColorIndex = xlAutomatic : .Color = 5296274 : .TintAndShade = 0 : .PatternTintAndShade = 0 : End With
-
- xlSheet.Range("AF1:AH3").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
-
- xlSheet.Range("A1:G2").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With : myExcel.Selection.Merge
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 16 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone
- End With
-
- xlSheet.Range("X3").Activate() : myExcel.Selection.ColumnWidth = 8
- xlSheet.Columns("Y:Y").Select : myExcel.Selection.ColumnWidth = 12
- xlSheet.Range("X2:Y2").Select() : myExcel.Selection.NumberFormatLocal = "#,##0.00;[紅色]-#,##0.00"
-
- xlSheet.Range("X1:Y2").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
- With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = 0 : .TintAndShade = 0 : .Weight = xlThin : End With
-
- xlSheet.Columns("AA:AE").Select : myExcel.Selection.ColumnWidth = 10
-
- xlSheet.Range("X1:Y1").Select()
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
-
- xlSheet.Range("H1:I1").Select()
- With myExcel.Selection : .HorizontalAlignment = xlRight : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = True : End With
- End Sub
- End Class
|