销项发票明细表整理
Sub 銷項發票()
Dim i, j, k, m, n
Dim hang1, hang2, hang_count, lie_spmc
Dim arr_neibu, mrr, p
Dim dic As Object
Set dic = CreateObject("Scripting.Dictionary")
Dim ws As Worksheetarr_neibu = Array("深圳市瑞意博科技股份有限公司", _
"深圳市瑞意博醫療設備有限公司", _
"深圳市矽海數據采集系統有限公司", _
"深圳市瑞意博信息技術有限公司", _
"上海瑞意博信息科技有限公司", _
"武漢市瑞意博信息科技有限公司")
For i = 0 To UBound(arr_neibu)dic(arr_neibu(i)) = ""
Next i
'lie_spmc = Range("6:6").Find("商品名稱").Column
Range("A:A").Find("份數").EntireRow.Delete
hang1 = Range("J6").End(xlDown).Row'填充空白行
For m = 7 To hang1For n = 1 To 7If Cells(m, n) = "" ThenCells(m, n) = Cells(m - 1, n)End IfNext n
Next m
'刪除小計行
For j = hang1 To 7 Step -1If Range("J" & j).Value = "小計" ThenRange("J" & j).EntireRow.DeleteEnd If
Next jRange("A6").End(xlToRight).Offset(0, 1).Value = "含稅金額"
Range("A6").End(xlToRight).Offset(0, 1).Value = "客戶類別"
hang2 = Range("J6").End(xlDown).Row
For k = 7 To hang2If dic.exists(Range("C" & k).Value) ThenRange("T" & k) = "內部公司"ElseRange("T" & k) = "外部公司"End If
Next kmrr = Range("M6:Q" & hang2)
For p = 1 To UBound(mrr, 1)For q = 1 To UBound(mrr, 2)mrr(p, q) = mrr(p, q)Next q
Next p
Range("M6").Resize(UBound(mrr, 1), UBound(mrr, 2)) = mrr
Range("S7") = "=O7+Q7"
Range("S7").AutoFill Range("S7:S" & hang2), 4
Range("O7:S" & hang2).NumberFormatLocal = "#,##0.00_ "
Range("S6:T" & hang2).Font.Size = 9
Range("A:T").ColumnWidth = 8
Cells(1, 1).Select
Cells(7, 3).Select
ActiveWindow.FreezePanes = True
Range("A6:T" & hang2).AutoFilter
Sheets.Add after:=Sheets(Sheets.Count)
Set ws = Sheets(Sheets.Count)
ws.Name = "TSB"
End Sub
總結
- 上一篇: 像素时钟 点时钟 dotclock pi
- 下一篇: PDF在线转PPT,不用下载软件网页在线