明升m88备用网址网

 找回暗码
 注册

QQ登录

只需一步,快速开端

你正在寻觅更好的Excel学习教程吗?Excel技巧80集+数据透视表+明升88初中高全套+VBA80集,想学的这儿全都有
检查: 41|回复: 0
打印 上一主题 下一主题

[求助] VBA 求助

[仿制链接]
跳转到指定楼层
1楼
宣布于 2019-6-21 11:49 | 只看该作者 回帖奖赏 |倒序阅览 |阅览形式
1学分


我期望每次執行DO循環時下面下面標紅的這個2能够加1,



Dim r As Worksheet, i As Long, e As Worksheet, W As Long
Set r = Worksheets("匯總")
Set e = Worksheets("原始數據")
W = e.Cells(Rows.Count, 1).End(xlUp).Row
r.Range("b2:f1100") = ""
i = 2
e.Activate
Do While r.Cells(i, 1) <> ""
r.Cells(i, 2) = e.Application.WorksheetFunction.CountIfs(Range("v:cm"), r.Cells(i, 1))
e.Range("b2" & ":" & "b" & W) = "=COUNTIFS(C2:XFD2,匯總!A$2)"
r.Cells(i, 3) = Application.WorksheetFunction.CountIfs(e.Range("b:b"), "=1", e.Range("c:c"), "REPAIR OK")
r.Cells(i, 4) = Application.WorksheetFunction.CountIfs(e.Range("b:b"), ">1", e.Range("c:c"), "REPAIR OK") + Application.WorksheetFunction.CountIfs(e.Range("b:b"), ">=1", e.Range("c:c"), "Scraped")
    r.Cells(i, 5) = r.Cells(i, 3) / r.Cells(i, 2)
     r.Cells(i, 6) = Application.WorksheetFunction.CountIfs(e.Range("b:b"), ">=1", e.Range("c:c"), "REPAIR OK") / r.Cells(i, 2)

i = i + 1

Loop
End Sub


共享到:  QQ老友和群QQ老友和群
保藏保藏
您需求登录后才能够回帖 登录 | 注册

本版积分规矩

小黑屋|手机版|Archiver|明升m88备用网址 ( 豫ICP备11015029号 )

GMT+8, 2019-6-29 18:42 , Processed in 0.050001 second(s), 2 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 回来顶部 回来列表