为什么不能到sheet2?
时间:2011-08-06
来源:互联网
各位大侠,下面的代码为什么有问题。请指教!谢谢!
Private Sub CommandButton2_Click()
Dim j As Integer
For j = 1 To 10
Sheets("sheet1").Cells(j, 1).Select
Selection.ClearContents
Sheets("sheet1").Cells(j, 6).Select
Selection.ClearContents
Sheets("sheet2").Cells(j, 3).Select
Selection.ClearContents
Next
End Sub
Private Sub CommandButton2_Click()
Dim j As Integer
For j = 1 To 10
Sheets("sheet1").Cells(j, 1).Select
Selection.ClearContents
Sheets("sheet1").Cells(j, 6).Select
Selection.ClearContents
Sheets("sheet2").Cells(j, 3).Select
Selection.ClearContents
Next
End Sub
作者: peng_lis7 发布时间: 2011-08-06
先要激活
复制内容到剪贴板
Dim j As Integer
For j = 1 To 10
Sheets("sheet1").Select
Sheets("sheet1").Cells(j, 1).Select
Selection.ClearContents
Sheets("Sheet2").Select
Sheets("Sheet2").Cells(j, 3).Select
Selection.ClearContents
Next j
End Sub
[ 本帖最后由 佛山小老鼠 于 2011-8-6 19:44 编辑 ] 代码:
Sub 按钮1_单击()Dim j As Integer
For j = 1 To 10
Sheets("sheet1").Select
Sheets("sheet1").Cells(j, 1).Select
Selection.ClearContents
Sheets("Sheet2").Select
Sheets("Sheet2").Cells(j, 3).Select
Selection.ClearContents
Next j
End Sub
作者: 佛山小老鼠 发布时间: 2011-08-06
搞定了,谢谢大哥!
作者: peng_lis7 发布时间: 2011-08-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28