标题: 程序运行提示“溢出”,原因是什么? [打印本页] 作者: yfg323 时间: 2006-12-11 22:49 标题: 程序运行提示“溢出”,原因是什么? Private Sub Worksheet_Activate()
Dim y As Integer '列值
Dim x As Integer '表1的行值
Dim z As Integer '表2的行值
z = 2
For x = 2 To Sheet1.Rows.Count ‘程序运行到这里提示“溢出”。
If (Sheet1.Cells(x, 1).Value <> "") Then
For y = 1 To 7
Cells(z - 1, y).Value = Sheet1.Cells(1, y)
Cells(z, y).Value = Sheet1.Cells(x, y)
Next y
z = z + 2
Else: GoTo ENDSUB