クラウド工房KUブログマガジン

暇なおじさん。
囲碁(四段)2013年10月取得、自炊本の作成、Excelマクロを利用したプログラム作成。

「第五章 仕訳帳入力のプログラム仕様書の10」

2013年09月10日 21時12分13秒 | 日記
クラウド工房KU 「Kindle」2013年 9月10日
Excel「三角形の計算」
クリエーター情報なし
牛島 一夫

page77

 (6-8)試算表予算対比表

 精算表の出力を行います。

  1. 「Step41」、管理番号、年をもとに発生集計データを抽出します
  2. 「Step42」、抽出データをソートします。
  3. 「Step43」、試算表予算対比表データ用に集計する
  4. 「Step44」、試算表予算対比表データを分析する
  5. 「Step45」、試算対比表を出力します

「開 始」


Sub ボタン6_Click()
With Worksheets("Menu")
Call Step_41(.Range("SystemNo").Value, _
.Range("wsa").Value, _
.Range("sab").Value, _
.Range("mma").Value)
Call Step_42
Call Step_43(.Range("sab").Value)
Call Step_44
Call Step_45
End With
End Sub
page78

「Step-41」

Function Step_41(Work_Sy As Integer, Work_nen As Integer, _
Work_tuki As Integer, Work_yosan As Integer) As String
'┌─────────────────────────────────┐
Dim SvrNo As Integer
Dim FoundCell As Variant
Dim Pi As Integer
Dim FarstNo As Integer
Dim Work_ken As String
Dim 行 As Integer
'情報分類 予算・・0、前年・・1、実績・・2
'----------------------------------------------------------------
'実績
Work_ken = Format(Work_Sy, "00") & Format(Work_nen, "0000")
With Workbooks("OutDB.xlsx")
.Worksheets("Taihi_print").Cells(2, 2).Value = _
Format(Work_nen, "0000") & "年" & _
Work_tuki & "月度 試算表予算対比表"
Set FoundCell = .Worksheets("Zan_data").Columns("K:K") _
.Find(Work_ken, LookIn:=xlValues, LookAt:=xlWhole)
If FoundCell Is Nothing Then
Pi = 9
Else
SvrNo = FoundCell.Row
FarstNo = SvrNo
End If
行 = 1
.Worksheets("Work_NY").Range("1:9999").Delete
.Worksheets("Work_NY").Cells(行, 1).Value = "任意分類"
.Worksheets("Work_NY").Cells(行, 2).Value = "年"
.Worksheets("Work_NY").Cells(行, 3).Value = "科目コード"
.Worksheets("Work_NY").Cells(行, 4).Value = "月"
.Worksheets("Work_NY").Cells(行, 5).Value = "情報分類"
.Worksheets("Work_NY").Cells(行, 6).Value = "借方"
.Worksheets("Work_NY").Cells(行, 7).Value = "貸方"
.Worksheets("Work_NY").Cells(行, 8).Value = "ソートキー"
行 = 行 + 1
Do While Pi <> 9
.Worksheets("Work_NY").Cells(行, 8).NumberFormat = "@"
.Worksheets("Work_NY").Cells(行, 1).Value = _
yRead_Bn(.Worksheets("Zan_data").Cells(SvrNo, 4).Value)
.Worksheets("Work_NY").Cells(行, 2).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 2).Value
.Worksheets("Work_NY").Cells(行, 3).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 4).Value
.Worksheets("Work_NY").Cells(行, 4).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 3).Value
.Worksheets("Work_NY").Cells(行, 5).Value = 2
.Worksheets("Work_NY").Cells(行, 6).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 5).Value + _
.Worksheets("Zan_data").Cells(SvrNo, 7).Value
.Worksheets("Work_NY").Cells(行, 7).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 6).Value + _
.Worksheets("Zan_data").Cells(SvrNo, 8).Value
.Worksheets("Work_NY").Cells(行, 8).Value = _
Format(.Worksheets("Work_NY").Cells(行, 1).Value, "00") & _
Format(.Worksheets("Work_NY").Cells(行, 2).Value, "0000") & _
Format(.Worksheets("Work_NY").Cells(行, 3).Value, "000") & _
Format(.Worksheets("Work_NY").Cells(行, 4).Value, "00") & _
Format(.Worksheets("Work_NY").Cells(行, 5).Value, "0")
page79

続き

 
行 = 行 + 1
Set FoundCell = .Worksheets("Zan_data").Columns("K:K") _
.Find(Work_ken, LookIn:=xlFormulas, After:=FoundCell)
If FoundCell Is Nothing Then
Pi = 9
Else
SvrNo = FoundCell.Row
If SvrNo = FarstNo Then
Pi = 9
End If
End If
Loop
End With
'----------------------------------------------------------------
'前年
Work_ken = Format(Work_Sy, "00") & Format(Work_nen - 1, "0000")
With Workbooks("OutDB.xlsx")
Set FoundCell = .Worksheets("Zan_data").Columns("K:K") _
.Find(Work_ken, LookIn:=xlValues, LookAt:=xlWhole)
If FoundCell Is Nothing Then
Pi = 9
Else
SvrNo = FoundCell.Row
FarstNo = SvrNo
End If
行 = 行 + 1
Do While Pi <> 9
.Worksheets("Work_NY").Cells(行, 8).NumberFormat = "@"
.Worksheets("Work_NY").Cells(行, 1).Value = _
yRead_Bn(.Worksheets("Zan_data").Cells(SvrNo, 4).Value)
.Worksheets("Work_NY").Cells(行, 2).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 2).Value
.Worksheets("Work_NY").Cells(行, 3).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 4).Value
.Worksheets("Work_NY").Cells(行, 4).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 3).Value
.Worksheets("Work_NY").Cells(行, 5).Value = 2
.Worksheets("Work_NY").Cells(行, 6).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 5).Value + _
.Worksheets("Zan_data").Cells(SvrNo, 7).Value
.Worksheets("Work_NY").Cells(行, 7).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 6).Value + _
.Worksheets("Zan_data").Cells(SvrNo, 8).Value
.Worksheets("Work_NY").Cells(行, 8).Value = _
Format(.Worksheets("Work_NY").Cells(行, 1).Value, "00") & _
Format(.Worksheets("Work_NY").Cells(行, 2).Value, "0000") & _
Format(.Worksheets("Work_NY").Cells(行, 3).Value, "000") & _
Format(.Worksheets("Work_NY").Cells(行, 4).Value, "00") & _
Format(.Worksheets("Work_NY").Cells(行, 5).Value, "0")
page80

続き

 
行 = 行 + 1
Set FoundCell = .Worksheets("Zan_data").Columns("K:K") _
.Find(Work_ken, LookIn:=xlFormulas, After:=FoundCell)
If FoundCell Is Nothing Then
Pi = 9
Else
SvrNo = FoundCell.Row
If SvrNo = FarstNo Then
Pi = 9
End If
End If
Loop
End With
'----------------------------------------------------------------
'予算
Work_ken = Format(Work_yosan, "00") & Format(Work_nen, "0000")
With Workbooks("OutDB.xlsx")
Set FoundCell = .Worksheets("Zan_data").Columns("K:K") _
.Find(Work_ken, LookIn:=xlValues, LookAt:=xlWhole)
If FoundCell Is Nothing Then
Pi = 9
Else
SvrNo = FoundCell.Row
FarstNo = SvrNo
End If
行 = 行 + 1
Do While Pi <> 9
.Worksheets("Work_NY").Cells(行, 8).NumberFormat = "@"
.Worksheets("Work_NY").Cells(行, 1).Value = _
yRead_Bn(.Worksheets("Zan_data").Cells(SvrNo, 4).Value)
.Worksheets("Work_NY").Cells(行, 2).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 2).Value
.Worksheets("Work_NY").Cells(行, 3).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 4).Value
.Worksheets("Work_NY").Cells(行, 4).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 3).Value
.Worksheets("Work_NY").Cells(行, 5).Value = 2
.Worksheets("Work_NY").Cells(行, 6).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 5).Value + _
.Worksheets("Zan_data").Cells(SvrNo, 7).Value
.Worksheets("Work_NY").Cells(行, 7).Value = _
.Worksheets("Zan_data").Cells(SvrNo, 6).Value + _
.Worksheets("Zan_data").Cells(SvrNo, 8).Value
.Worksheets("Work_NY").Cells(行, 8).Value = _
Format(.Worksheets("Work_NY").Cells(行, 1).Value, "00") & _
Format(.Worksheets("Work_NY").Cells(行, 2).Value, "0000") & _
Format(.Worksheets("Work_NY").Cells(行, 3).Value, "000") & _
Format(.Worksheets("Work_NY").Cells(行, 4).Value, "00") & _
Format(.Worksheets("Work_NY").Cells(行, 5).Value, "0")
page81

続き


行 = 行 + 1
Set FoundCell = .Worksheets("Zan_data").Columns("K:K") _
.Find(Work_ken, LookIn:=xlFormulas, After:=FoundCell)
If FoundCell Is Nothing Then
Pi = 9
Else
SvrNo = FoundCell.Row
If SvrNo = FarstNo Then
Pi = 9
End If
End If
Loop
End With
'└─────────────────────────────────┘
End Function

「Step-42」


Function Step_42() As String

With Workbooks("OutDB.xlsx").Worksheets("Work_NY")
'┌─────────────────────────────────┐
.Range("A:H").Sort _
Key1:=.Columns("H"), order1:=xlAscending, _
Header:=xlYes
'└─────────────────────────────────┘
End With
End Function

「Step-43」


Function Step_43(Wk_tuki As Integer) As String
Dim Pi As Integer
Dim I As Integer
Dim MaxRow As Integer
Dim MaxIn As Integer
Dim Work_KM As Integer
Dim Work_name As String
Dim Work_tai As String
Dim Work_Bn As Integer
Dim Work_Jb As Integer
Dim Work_Sum1 As Double
Dim Work_Sum2 As Double
Dim Work_Sum3 As Double
Dim Work_Sum4 As Double
Dim Work_Sum5 As Double
Dim Work_Sum6 As Double
page82

続き

 
With Workbooks("OutDB.xlsx")
MaxIn = .Worksheets("Work_NY").Range("A1").End(xlDown).Row
MaxRow = 1
.Worksheets("Work_Sum").Range("1:9999").Delete
.Worksheets("Work_Sum").Cells(MaxRow, 1).Value = "任意分類"
.Worksheets("Work_Sum").Cells(MaxRow, 2).Value = "科目コード"
.Worksheets("Work_Sum").Cells(MaxRow, 3).Value = "科目名"
.Worksheets("Work_Sum").Cells(MaxRow, 4).Value = "貸借"
.Worksheets("Work_Sum").Cells(MaxRow, 5).Value = "予算借方"
.Worksheets("Work_Sum").Cells(MaxRow, 6).Value = "予算貸方"
.Worksheets("Work_Sum").Cells(MaxRow, 7).Value = "前年借方"
.Worksheets("Work_Sum").Cells(MaxRow, 8).Value = "前年正貸方"
.Worksheets("Work_Sum").Cells(MaxRow, 9).Value = "実績借方"
.Worksheets("Work_Sum").Cells(MaxRow, 10).Value = "実績貸方"
.Worksheets("Work_Sum").Cells(MaxRow, 11).Value = "構成比"
.Worksheets("Work_Sum").Cells(MaxRow, 12).Value = "予算差"
.Worksheets("Work_Sum").Cells(MaxRow, 13).Value = "前年差"
For I = 2 To MaxIn + 1
If I > MaxIn Then
.Worksheets("Work_NY").Cells(I, 4).Value = 999
End If
If I = 2 Then
Work_KM = .Worksheets("Work_NY").Cells(I, 3).Value
Work_name = mRead_KM(Work_KM)
Work_tai = yRead_KM(Work_KM)
Work_Bn = yRead_Bn(Work_KM)
Work_Jb = .Worksheets("Work_NY").Cells(I, 5).Value
Work_Sum1 = 0
Work_Sum2 = 0
Work_Sum3 = 0
Work_Sum4 = 0
Work_Sum5 = 0
Work_Sum6 = 0
End If
If Work_KM <> .Worksheets("Work_NY").Cells(I, 3).Value Then
MaxRow = MaxRow + 1
.Worksheets("Work_Sum").Cells(MaxRow, 1).Value = Work_Bn
.Worksheets("Work_Sum").Cells(MaxRow, 2).Value = Work_KM
.Worksheets("Work_Sum").Cells(MaxRow, 3).Value = Work_name
.Worksheets("Work_Sum").Cells(MaxRow, 4).Value = Work_tai
.Worksheets("Work_Sum").Cells(MaxRow, 5).Value = Work_Sum1
.Worksheets("Work_Sum").Cells(MaxRow, 6).Value = Work_Sum2
.Worksheets("Work_Sum").Cells(MaxRow, 7).Value = Work_Sum3
.Worksheets("Work_Sum").Cells(MaxRow, 8).Value = Work_Sum4
.Worksheets("Work_Sum").Cells(MaxRow, 9).Value = Work_Sum5
.Worksheets("Work_Sum").Cells(MaxRow, 10).Value = Work_Sum6
Work_KM = .Worksheets("Work_NY").Cells(I, 3).Value
Work_name = mRead_KM(Work_KM)
Work_tai = yRead_KM(Work_KM)
Work_Bn = yRead_Bn(Work_KM)
Work_Jb = .Worksheets("Work_NY").Cells(I, 5).Value
Work_Sum1 = 0
Work_Sum2 = 0
Work_Sum3 = 0
Work_Sum4 = 0
Work_Sum5 = 0
Work_Sum6 = 0
End If

page83

続き


If .Worksheets("Work_NY").Cells(I, 4).Value <= Wk_tuki Then
Select Case .Worksheets("Work_NY").Cells(I, 5).Value
Case 0:
If Work_tai = "借" Then
Work_Sum1 = Work_Sum1 + .Worksheets("Work_NY").Cells(I, 6).Value _
- .Worksheets("Work_NY").Cells(I, 7).Value
Else
Work_Sum2 = Work_Sum2 - .Worksheets("Work_NY").Cells(I, 6).Value _
+ .Worksheets("Work_NY").Cells(I, 7).Value
End If
Case 1:
If Work_tai = "借" Then
Work_Sum3 = Work_Sum3 + .Worksheets("Work_NY").Cells(I, 6).Value _
- .Worksheets("Work_NY").Cells(I, 7).Value
Else
Work_Sum4 = Work_Sum4 - .Worksheets("Work_NY").Cells(I, 6).Value _
+ .Worksheets("Work_NY").Cells(I, 7).Value
End If
Case 2:
If Work_tai = "借" Then
Work_Sum5 = Work_Sum5 + .Worksheets("Work_NY").Cells(I, 6).Value _
- .Worksheets("Work_NY").Cells(I, 7).Value
Else
Work_Sum6 = Work_Sum6 - .Worksheets("Work_NY").Cells(I, 6).Value _
+ .Worksheets("Work_NY").Cells(I, 7).Value
End If
End Select
End If
Next
End With
End Function

「Step-44」

      
Function Step_44() As String
Dim SvrNo As Integer
Dim FoundCell As Variant
Dim Pi As Integer
Dim I As Integer
Dim Work_Bn As Integer
Dim MaxRow As Integer
Dim MaxIn As Integer
Dim Work_Sum1 As Double
With Workbooks("OutDB.xlsx").Worksheets("Work_Sum")
MaxRow = 1
MaxIn = .Range("A1").End(xlDown).Row
.Range("N:O").Value = ""
.Cells(MaxRow, 14).Value = "任意分類"
.Cells(MaxRow, 15).Value = "合計"
page84

続き

          
For I = 2 To MaxIn + 1
If I > MaxIn Then
.Cells(I, 1).Value = 999
End If
If I = 2 Then
Work_Bn = .Cells(I, 1).Value
Work_Sum1 = 0
End If
If Work_Bn <> .Cells(I, 1).Value Then
MaxRow = MaxRow + 1
.Cells(MaxRow, 14).Value = Work_Bn
.Cells(MaxRow, 15).Value = Work_Sum1
Work_Sum1 = 0
Work_Bn = .Cells(I, 1).Value
End If
If .Cells(I, 4).Value = "借" Then
If .Cells(I, 9).Value > 0 Then
Work_Sum1 = Work_Sum1 + .Cells(I, 9).Value
End If
Else
If .Cells(I, 10).Value > 0 Then
Work_Sum1 = Work_Sum1 + .Cells(I, 10).Value
End If
End If
Next
For I = 2 To MaxIn
Set FoundCell = .Columns("N:N").Find(.Cells(I, 1).Value, LookIn:=xlValues, LookAt:=xlWhole)
If FoundCell Is Nothing Then
Pi = 9
Else
SvrNo = FoundCell.Row
End If
If Pi <> 9 Then
.Cells(I, 11).Value = .Cells(SvrNo, 15).Value
End If
If .Cells(I, 4).Value = "借" Then
.Cells(I, 12).Value = .Cells(I, 9).Value - .Cells(I, 5).Value
.Cells(I, 13).Value = .Cells(I, 9).Value - .Cells(I, 7).Value
Else
.Cells(I, 12).Value = .Cells(I, 10).Value - .Cells(I, 6).Value
.Cells(I, 13).Value = .Cells(I, 10).Value - .Cells(I, 8).Value
End If
Next
End With
End Function
page85

「Step-45」

          
Function Step_45() As String
Dim SvrNo As Integer
Dim FoundCell As Range
Dim 行 As Integer
Dim Pi As Integer
Dim FarstNo As Integer
Dim Work_ken As String
Dim MaxRow As Integer
Dim MaxIn As Integer
Dim I As Integer
Dim N As Integer
Dim Work_A As Double
Dim Work_B As Double
Dim Gokei1 As Double
Dim Gokei2 As Double
Dim Gokei3 As Double
Dim Gokei4 As Double
Dim Gokei5 As Double
Dim Gokei6 As Double
Dim Rieki As Double
Dim border1 As Border
Dim border2 As Border
Dim border3 As Border
With Workbooks("OutDB.xlsx")
.Worksheets("Taihi_print").Range("6:9999").Delete
MaxRow = 5
MaxIn = .Worksheets("Work_Sum").Range("A1").End(xlDown).Row
Gokei1 = 0
Gokei2 = 0
Gokei3 = 0
Gokei4 = 0
Gokei5 = 0
Gokei6 = 0
For I = 2 To MaxIn
If .Worksheets("Work_Sum").Cells(I, 1).Value = 999 Then
Exit For
End If
MaxRow = MaxRow + 1
.Worksheets("Taihi_print").Rows(MaxRow).RowHeight = "19"
.Worksheets("Taihi_print").Cells(MaxRow, 4).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 5).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 6).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 7).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 8).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 9).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 10).NumberFormat = "###.##"
For N = 2 To 12
Set border1 = .Worksheets("Taihi_print").Cells(MaxRow, N).Borders(xlEdgeLeft)
Set border2 = .Worksheets("Taihi_print").Cells(MaxRow, N).Borders(xlEdgeBottom)
Set border3 = .Worksheets("Taihi_print").Cells(MaxRow, N).Borders(xlEdgeRight)
border1.LineStyle = xlContinuous
border2.LineStyle = xlContinuous
border3.LineStyle = xlContinuous
border1.Weight = xlThin
border2.Weight = xlThin
border3.Weight = xlThin
Next

page86

続き

          
.Worksheets("Taihi_print").Cells(MaxRow, 2).Value = .Worksheets("Work_Sum").Cells(I, 2).Value
.Worksheets("Taihi_print").Cells(MaxRow, 3).Value = .Worksheets("Work_Sum").Cells(I, 3).Value

.Worksheets("Taihi_print").Cells(MaxRow, 4).Value = .Worksheets("Work_Sum").Cells(I, 5).Value
.Worksheets("Taihi_print").Cells(MaxRow, 5).Value = .Worksheets("Work_Sum").Cells(I, 6).Value
.Worksheets("Taihi_print").Cells(MaxRow, 6).Value = .Worksheets("Work_Sum").Cells(I, 7).Value
.Worksheets("Taihi_print").Cells(MaxRow, 7).Value = .Worksheets("Work_Sum").Cells(I, 8).Value
.Worksheets("Taihi_print").Cells(MaxRow, 8).Value = .Worksheets("Work_Sum").Cells(I, 9).Value
.Worksheets("Taihi_print").Cells(MaxRow, 9).Value = .Worksheets("Work_Sum").Cells(I, 10).Value
If .Worksheets("Work_Sum").Cells(I, 4).Value = "借" Then
If .Worksheets("Work_Sum").Cells(I, 9).Value > 0 Then
.Worksheets("Taihi_print").Cells(MaxRow, 10).Value = _
.Worksheets("Work_Sum").Cells(I, 9).Value / _
.Worksheets("Work_Sum").Cells(I, 11).Value * 100
Else
.Worksheets("Taihi_print").Cells(MaxRow, 10).Value = "----"
.Worksheets("Taihi_print").Cells(MaxRow, 10).HorizontalAlignment = xlCenter
End If
Work_A = .Worksheets("Work_Sum").Cells(I, 5).Value
Work_B = .Worksheets("Work_Sum").Cells(I, 7).Value
Else
If .Worksheets("Work_Sum").Cells(I, 10).Value > 0 Then
.Worksheets("Taihi_print").Cells(MaxRow, 10).Value = _
.Worksheets("Work_Sum").Cells(I, 10).Value / _
.Worksheets("Work_Sum").Cells(I, 11).Value * 100
Else
.Worksheets("Taihi_print").Cells(MaxRow, 10).Value = "----"
.Worksheets("Taihi_print").Cells(MaxRow, 10).HorizontalAlignment = xlCenter
End If
Work_A = .Worksheets("Work_Sum").Cells(I, 6).Value
Work_B = .Worksheets("Work_Sum").Cells(I, 8).Value
End If
If .Worksheets("Work_Sum").Cells(I, 12).Value < 0 Then
.Worksheets("Taihi_print").Cells(MaxRow, 11).Value = "↓"
Else
.Worksheets("Taihi_print").Cells(MaxRow, 11).Value = "↑"
End If
If ((Work_A * 0.1) * -1 < .Worksheets("Work_Sum").Cells(I, 12).Value And _
.Worksheets("Work_Sum").Cells(I, 12).Value < Work_A * 0.1) _
Or .Worksheets("Work_Sum").Cells(I, 12).Value = 0 Then
.Worksheets("Taihi_print").Cells(MaxRow, 11).Value = "→"
End If

If .Worksheets("Work_Sum").Cells(I, 13).Value < 0 Then
.Worksheets("Taihi_print").Cells(MaxRow, 12).Value = "↓"
Else
.Worksheets("Taihi_print").Cells(MaxRow, 12).Value = "↑"
End If

page87

続き

          
If ((Work_B * 0.1) * -1 < .Worksheets("Work_Sum").Cells(I, 13).Value And _
.Worksheets("Work_Sum").Cells(I, 12).Value < Work_B * 0.1) Or _
.Worksheets("Work_Sum").Cells(I, 12).Value = 0 Then
.Worksheets("Taihi_print").Cells(MaxRow, 12).Value = "→"
End If
Gokei1 = Gokei1 + .Worksheets("Work_Sum").Cells(I, 5).Value
Gokei2 = Gokei2 + .Worksheets("Work_Sum").Cells(I, 6).Value
Gokei3 = Gokei3 + .Worksheets("Work_Sum").Cells(I, 7).Value
Gokei4 = Gokei4 + .Worksheets("Work_Sum").Cells(I, 8).Value
Gokei5 = Gokei5 + .Worksheets("Work_Sum").Cells(I, 9).Value
Gokei6 = Gokei6 + .Worksheets("Work_Sum").Cells(I, 10).Value
Next
MaxRow = MaxRow + 1
.Worksheets("Taihi_print").Rows(MaxRow).RowHeight = "19"
.Worksheets("Taihi_print").Cells(MaxRow, 4).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 5).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 6).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 7).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 8).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 9).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 10).NumberFormat = "#,###"
.Worksheets("Taihi_print").Cells(MaxRow, 11).NumberFormat = "#.##"
For N = 2 To 12
Set border1 = .Worksheets("Taihi_print").Cells(MaxRow, N).Borders(xlEdgeLeft)
Set border2 = .Worksheets("Taihi_print").Cells(MaxRow, N).Borders(xlEdgeB

最新の画像もっと見る

コメントを投稿