Sub m_loss()
Dim d_m, r, r_loss As Integer
Dim date_new As Date
r = Range("a65536").End(xlUp).Row
r_loss = Sheets("LOSS").Range("a65536").End(xlUp).Row
zyname = InputBox("請輸入廠名")
d_m = Int(InputBox("請輸入月份date_m")) '注意數據轉換 2003,2007 好像版本不一樣
Sheets("LOSS").Cells(r_loss + 4, 1) = zyname & "的" & d_m & "月清金損耗"
Sheets("LOSS").Cells(r_loss + 4, 1).Interior.ColorIndex = 4
Sheets("LOSS").Cells(r_loss + 4, 1).Font.Bold = True
j = 5
For i = r To 1 Step -1
If Month(Cells(i, 3)) = d_m And Cells(i, 1).Value = "MX" Then
Sheets("LOSS").Cells(r_loss + j, 1).Value = Cells(i, 1) '
Sheets("LOSS").Cells(r_loss + j, 2).Value = Cells(i, 2) '
Sheets("LOSS").Cells(r_loss + j, 3) = Cells(i, 3) '日期
vba 提取数据
最新推荐文章于 2024-06-01 22:47:27 发布
Sub m_loss() Dim d_m, r, r_loss As Integer Dim date_new As Dater = Range("a65536").End(xlUp).Rowr_loss = Sheets("LOSS").Range("a65536").End(xlUp).Row zyname = InputBox("請輸入廠名")d_m = Int(In...
摘要由CSDN通过智能技术生成