set ws=createobject("wscript.shell")
ws.run"f:\欠费客户表.xls",1,ture
while 1
WScript.Sleep 1000
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^{c}"
WScript.Sleep 1000
WshShell.SendKeys "%{tab}"
WScript.Sleep 1000
WshShell.SendKeys "^{v}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "%{tab}"
WScript.Sleep 1000
WshShell.SendKeys "{RIGHT}"
WScript.Sleep 1000
WshShell.SendKeys "^{c}"
WScript.Sleep 1000
WshShell.SendKeys "%{tab}"
WScript.Sleep 1000
WshShell.SendKeys "^{v}"
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "^{v}"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "%{tab}"
WScript.Sleep 1000
WshShell.SendKeys "%{DOWN}"
WScript.Sleep 1000
WshShell.SendKeys "%{LEFT}"
WScript.Sleep 1000
wend
配置到一个数组中写循环就是了
比如说
dim a(10)
a(0)="%{tab}"
.....
碰上需要多个key发送的,可以考虑用分割符 比如说用{$,$}
a(5)="^{v}{$,$}{ENTER}{$,$}^{v}"
for i=0 to ubound(a)
split(a(i), "{$,$}") '这个地方再来个数组进行循环
WshShell.SendKeys "^{c}"
'第二个循环结束
WshShell.Sleep 1000
next
基本这样就完事了,伪代码,vbs代码记得不周全了,需要自己查查
用循环,for 或 while 自己查查用法