
EXCEL VBA if 循环语句
我写了下面一段代码,可以DEBUG的时候提示说nextwithoutfor,可是我前面明明已经写了FOR的,请大侠们帮忙改一下,谢谢!在线等答案啊~Dimi%,a%a=S...
我写了下面一段代码,可以DEBUG的时候提示说 next without for,可是我前面明明已经写了FOR的,请大侠们帮忙改一下,谢谢!在线等答案啊~
Dim i%, a%
a = Sheets("source data from 201010 to (2)").Range("h1").CurrentRegion.Rows.Count
For i = 2 To a
If Cells(i, 6).Value = "NB" Then
Cells(i, 1) = Cells(i, 6).Value
Cells(i, 2) = Cells(i, 7).Value
Cells(i, 3) = Cells(i, 8).Value
Next i 展开
Dim i%, a%
a = Sheets("source data from 201010 to (2)").Range("h1").CurrentRegion.Rows.Count
For i = 2 To a
If Cells(i, 6).Value = "NB" Then
Cells(i, 1) = Cells(i, 6).Value
Cells(i, 2) = Cells(i, 7).Value
Cells(i, 3) = Cells(i, 8).Value
Next i 展开
2个回答
展开全部
不会吧,那么难。算了半天还没弄出来,你还是自己想想办法吧。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim i%, a%
a = Sheets("source data from 201010 to (2)").Range("h1").CurrentRegion.Rows.Count
For i = 2 To a
If Cells(i, 6).Value = "NB" Then
Cells(i, 1) = Cells(i, 6).Value
Cells(i, 2) = Cells(i, 7).Value
Cells(i, 3) = Cells(i, 8).Value
END IF
Next i
没有加END IF朋友!
a = Sheets("source data from 201010 to (2)").Range("h1").CurrentRegion.Rows.Count
For i = 2 To a
If Cells(i, 6).Value = "NB" Then
Cells(i, 1) = Cells(i, 6).Value
Cells(i, 2) = Cells(i, 7).Value
Cells(i, 3) = Cells(i, 8).Value
END IF
Next i
没有加END IF朋友!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询