标题:runtime erroe: 1004 application defined or object defined error
只看楼主
milkar
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-10-13
 问题点数:0 回复次数:1 
runtime erroe: 1004 application defined or object defined error
运行 下列程序段出现的错误:

Private Sub CommandButtonItem1_Click()
Dim item As Long
Dim rowInQuotationsheetBegin As Long
Dim rowInQuotationsheetEnd As Long

item = Worksheets("Sheet1").TextBoxItem1.Value


For i = 8 To 4000

If item = Worksheets("all").Cells(i, 6).Value Then
rowInQuotationsheetBegin = i
For j = i + 1 To i + 20

If Worksheets("all").Cells(j, 5).Value = "ITEM NO." Then
rowInQuotationsheetEnd = j - 1
Sheets("all").Select
Application.CutCopyMode = False
Rows("8:23").Select
'Rows([rowInQuotationsheetBegin : rowInQuotationsheetEnd]).Select
Selection.Copy
Sheets("QUOTATIONSHEET").Select
ActiveSheet.Paste
End If
Next j

End If

Next i

End Sub

还有我设了Dim rowInQuotationsheetBegin As Long
Dim rowInQuotationsheetEnd As Long来进行copy的动作但是rows或range要怎样应用变量名呢?

谢谢。
搜索更多相关主题的帖子: object defined application erroe 
2007-10-19 07:11
milkar
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-10-13
得分:0 
ding zi ding

2007-10-19 14:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-178927-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.697578 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved