请教VB,哪里不对啊

[复制链接]
查看11 | 回复2 | 2011-8-17 12:10:30 | 显示全部楼层 |阅读模式
For i = 1 To n

Cells(10 + i, 5) = (Cells(10 + i, 2) - Cells(9 + i, 2)) / Cells(9 + i, 2)

Cells(10 + i, 6) = Log(Cells(10 + i, 2) / Cells(10 + i, 4))

Range(Cells(10 + i, 4), Cells(10 + i, 5)).NumberFormat = "0.0000"

Next i

回复

使用道具 举报

千问 | 2011-8-17 12:10:30 | 显示全部楼层
1、数值运算要保证所有数据为数值,除法运算要保证除数不为0,参见对你另一问题的回答:http://zhidao.baidu.com/question/308069469.html2、Range用法错误,Range的用法为:Range("A1")、Range("A1","A2")、Range("A1:H100")...Range改为Cells,同时要保证Cells(10 + i, 4), Cells(10 + i, 5)为整数,否则的话Cells(1.5,1)是错误的。...
回复

使用道具 举报

千问 | 2011-8-17 12:10:30 | 显示全部楼层
能告诉下cells是什么吗?...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行