bwin官网网

 找回暗码
 注册

QQ登录

只需一步,快速开端

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

[求助] VBA 求助

[仿制链接]
m88 188bet uedbet 威廉希尔 明升 bwin 明升88 bodog bwin 明升m88.com 18luck 188bet unibet unibet Ladbrokes Ladbrokes casino m88明升 明升 明升 m88.com 188bet m88 明陞 uedbet赫塔菲官网 365bet官网 m88 help
跳转到指定楼层
1楼
宣布于 2019-6-21 11:50 | 只看该作者 回帖奖赏 |倒序阅览 |阅览形式
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老友和群
保藏保藏
2楼
宣布于 2019-6-29 19:03 | 只看该作者
Do While r.Cells(i, 1) <> ""
k = k +1'增加一个整数变量,第次循环增加1,请在Dim中补界说k&(或许as integer)
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+k)"
您需求登录后才能够回帖 登录 | 注册

本版积分规矩

小黑屋|手机版|Archiver|bwin官网 ( 豫ICP备11015029号 )

GMT+8, 2019-9-23 09:57 , Processed in 0.046800 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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