按键精灵excel 自动识别空白处

excel 自动识别空白处

运行环境:分辨率:1440×900 色深:32位 操作系统:Microsoft Windows XP 按键精灵版本:8.00.6874

ffice 插件 不支持 子程序 的 关闭 主程序 打开的 excel  子程序如果对 excel 操作的话 必须 再次 打开 在关闭  
  
UserVar lj = "c:\111.xls" "路径"  
  
//UserVar jl_s = 100000 "记录总条数"  
  
//hangs = Clng(jl_s)  
  
hangs = 65000  
  
Call 读取excel的空位置  
  
Sub 读取excel的空位置  
  
Call Plugin.Office.OpenXls(lj)  
  
Do while true  
  
    text = Plugin.Office.ReadXls(1, hangs, 3)  
    
    //MessageBox text  
      
    //MessageBox hangs  
  
    If text = ""  
      
        //代表 找到了一次 第二次找没出现  
        If dyc_y = true  
  
        sc_hangs = hangs  
          
        hangs = dw_hangs  
          
        Call 取中间值  
  
        Else  
  
        //上次扫描的 行数  
        sc_hangs = hangs  
  
        hangs = hangs / 2  
          
        Call 提出整数部分  
          
        End If  
   
    Else  
    //找到了 值得情况  
       If sc_hangs - hangs <= 10 Then  
         
        Plugin.Office.CloseXls  
          
        Call 逐行查找  
  
        Exit Do  
          
        End If  
  
       Call 取中间值  
  
       dyc_y = true  
          
    End If  
  
Loop  
  
End Sub  
  
MessageBox "最后的数是 :" & hangs  
  
Sub 取中间值  
  
        //找到有值得位置了 记录有值得位置 行数到 dw_hangs 定位行数   
        dw_hangs = hangs  
  
        hangs = sc_hangs - dw_hangs  
  
        hangs = hangs / 2  
  
        //转换成字符串 判断是否有小数点 有的话 就 保留 整数部分  
  
        Call 提出整数部分  
  
        hangs = hangs + dw_hangs  
  
  
End Sub  
  
Sub 逐行查找  
  
MessageBox "行数是:" & hangs & "进入逐行查找"  
  
Call Plugin.Office.OpenXls(lj)  
  
Do while true  
  
text = Plugin.Office.ReadXls(1, hangs, 3)  
    
If text <> "" Then 
hangs = hangs + 1  
  
Else  
  
Exit Do  
  
End If   
  
Loop  
  
Plugin.Office.CloseXls   
  
End Sub  
  
Sub 提出整数部分  
  
hangs = cstr(hangs)  
          
        //MessageBox "除以后的hangs值 :" & hangs  
  
        zhao_d = InStrRev(hangs,".",-1,1)  
          
       // MessageBox "小数点的位置是:" & zhao_d  
  
        If zhao_d <> 0 Then  
  
            hangs = Clng(left(hangs,zhao_d - 1))  
              
            //MessageBox "处理小数点后的hangs值:" & hangs  
  
        Else  
  
            hangs = Clng(hangs)  
  
        End If  
  
End Sub
相关文件下载地址
©下载资源版权归作者所有;本站所有资源均来源于网络,仅供学习使用,请支持正版!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注