作者:乔山办公网日期:
返回目录:excel表格制作
补充:看了一下你的截图, 不是调用其他过程的语句出错zhidao.应该是你的某个过程的单词拼写有问题.
你把光标移动到主程序,按F8单步执行看是哪句出错回,主程序没错,再把光标移动到其他的宏再单步执行检查.依次看时哪里的问题答.
Sub all()
第一个宏_黄
第三个宏_红
第二个宏_黑
End Sub
Sub 第一个宏_黄()
MsgBox "第一个宏"
End Sub
Sub 第二个宏_黑()
MsgBox "第二个宏"
End Sub
Sub 第三个宏_红()
MsgBox "第三个宏"
End Sub
第一步百,把文件保存为度 xlsm格式
第二问步,录入宏,把下面的代码复制答粘贴,保存宏,命名为qingkong
第三步回,插入图片,右键指定上qingkong这个宏即可。答
Sub qingkong()
Range("B9,B14,B19,B24,B29,B35,B40,B45,B50,B55").ClearContents
End Sub
5分少了,加分吧!
身边没有可用的office程序,试着写下吧:
sub macro1()
dim s1ce as string '记录表1中的CE列值e799bee5baa6e79fa5e98193e59b9ee7ad94366
dim s2ce as string '记录表2中的CE列值
dim s2r1 as string '记录表2中的顺序行值
dim s2r2 as string '记录表2中的查找行值
dim s1rn as integer '记录表1中的当前行号
dim s2rn as integer '记录表2中的当前行号
dim s3rn as integer '记录表3中的当前行号
s3rn=1
do '比较表1与表2的CE列值,并将相同的行复制到表3
s1ce=sheet1.range("C1").offset(s1rn,0).value
s1ce=s1ce & sheet1.range("E1").offset(s1rn,0).value
'取得表1中CE列值
do
s2ce=sheet1.range("C1").offset(s2rn,0).value
s2ce=s2ce & sheet1.range("E1").offset(s2rn,0).value
'取得表2中CE的值
if s1ce=s2ce then
sheet3.rows(s3rn).value=sheet1.rows(s1rn).value
s3rn=s3rn+1
sheet3.rows(s3rn).value=sheet2.rows(s2rn).value
s3rn=s3rn+1
end if '将表1和表2中重复的行复制到表3中
s2rn=s2rn+1
loop while s2ce<>""
s1rn=s1rn+1
loop while s1ce<>""
先做这么多,其中复制段可能有问题,因为我不太记得语法了.需要调试. 如果有兴趣, 可以追问,我找台可以用VBA的电脑再说.....