Excel精英培训网

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

[已解决]提示溢出,求助求助!在线等

[复制链接]
发表于 2016-8-23 17:19 | 显示全部楼层 |阅读模式

With Worksheets("步骤")
        wksSrc.Cells(359, "a").Value = .Range("c262").Value
        wksSrc.Cells(359, "d").Value = .Range("d262").Value
        wksSrc.Cells(359, "h").Value = .Range("e262").Value
       For irow = 263 To 266
           wksSrc.Cells(irow + 97, "a").Value = .Cells(irow, 3).Value
           wksSrc.Cells(irow + 97, "d").Value = .Cells(irow, 4).Value
           wksSrc.Cells(irow + 97, "h").Value = .Cells(irow, 5).Value

Next
    End With

With Worksheets("步骤")
        wksSrc.Cells(380, "b").Value = .Range("d285").Value
        wksSrc.Cells(380, "d").Value = .Range("e285").Value
        wksSrc.Cells(380, "e").Value = .Range("f285").Value
        wksSrc.Cells(380, "f").Value = .Range("g285").Value
        wksSrc.Cells(380, "h").Value = .Range("h285").Value
        For irow = 286 To 294
           wksSrc.Cells(irow + 111, "b").Value = .Cells(irow, 4).Value
           wksSrc.Cells(irow + 111, "d").Value = .Cells(irow, 5).Value
           wksSrc.Cells(irow + 111, "e").Value = .Cells(irow, 6).Value
           wksSrc.Cells(irow + 111, "f").Value = .Cells(irow, 7).Value
           wksSrc.Cells(irow + 111, "h").Value = .Cells(irow, 8).Value

Next
    End With

With Worksheets("步骤")
        wksSrc.Cells(392, "a").Value = .Range("d297").Value
        wksSrc.Cells(392, "c").Value = .Range("e297").Value
        wksSrc.Cells(392, "e").Value = .Range("f297").Value
        wksSrc.Cells(392, "f").Value = .Range("g297").Value
        wksSrc.Cells(392, "h").Value = .Range("h297").Value
        wksSrc.Cells(392, "i").Value = .Range("h297").Value
        For irow = 298 To 301
           wksSrc.Cells(irow + 95, "a").Value = .Cells(irow, 4).Value
           wksSrc.Cells(irow + 95, "c").Value = .Cells(irow, 5).Value
           wksSrc.Cells(irow + 95, "e").Value = .Cells(irow, 6).Value
           wksSrc.Cells(irow + 95, "f").Value = .Cells(irow, 7).Value
           wksSrc.Cells(irow + 95, "h").Value = .Cells(irow, 8).Value
           wksSrc.Cells(irow + 95, "i").Value = .Cells(irow, 9).Value

Next
    End With

End Sub



最佳答案
2016-8-23 18:02
太长了 看不懂,不过前面的定义变量错了额
dim irow as byte  应改为  as  integer
byte 数据范0-255 实际上你的行数超过了  
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2016-8-23 17:21 | 显示全部楼层
回复

使用道具 举报

 楼主| 发表于 2016-8-23 17:29 | 显示全部楼层
已上附件~求大神帮忙

测试.rar

81.88 KB, 下载次数: 7

回复

使用道具 举报

发表于 2016-8-23 18:02 | 显示全部楼层    本楼为最佳答案   
太长了 看不懂,不过前面的定义变量错了额
dim irow as byte  应改为  as  integer
byte 数据范0-255 实际上你的行数超过了  
回复

使用道具 举报

发表于 2016-8-23 18:36 | 显示全部楼层
改一句
  1. Dim irow As Long
复制代码
回复

使用道具 举报

发表于 2016-8-23 20:41 | 显示全部楼层
Byte 数据类型
请参阅     示例     特性

Byte 变量存储为单精度型、无符号整型、8 位(1个字节)的数值形式,范围在 0 至 255 之间。

Byte 数据类型在存储二进制数据时很有用。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-14 11:57 , Processed in 0.691750 second(s), 10 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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