Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 2486|回复: 2

[已解决]代码

[复制链接]
发表于 2014-2-22 12:38 | 显示全部楼层 |阅读模式
本帖最后由 642070295 于 2014-2-22 13:01 编辑

dim n%
n =Range("b1048576").End(xlUp).Offset(-16, 0).Row
Range("a1") = Application.Sum(Range("b& n&:b" & Range("b1048576").End(xlUp).Row))

请教一下各位大师,上述黄色条的代码提示“应用程序定义或对象定义错误”,怎么修改代码才正确呢?先谢了!

最佳答案
2014-2-22 12:45
dim n%
n = Range("b1048576").End(xlUp).Offset(-16, 0).Row

Range("a1") = Application.Sum(Range("b" & n & ":b" & Range("b1048576").End(xlUp).Row))
发表于 2014-2-22 12:45 | 显示全部楼层    本楼为最佳答案   
dim n%
n = Range("b1048576").End(xlUp).Offset(-16, 0).Row

Range("a1") = Application.Sum(Range("b" & n & ":b" & Range("b1048576").End(xlUp).Row))
回复

使用道具 举报

发表于 2014-2-22 19:01 | 显示全部楼层
回复

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-22 04:28 , Processed in 0.122169 second(s), 8 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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