| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 971 人关注过本帖
标题:excel vba语句转VB
取消只看楼主 加入收藏
hdx2008
Rank: 1
等 级:新手上路
帖 子:28
专家分:1
注 册:2008-12-23
结帖率:87.5%
收藏
已结贴  问题点数:20 回复次数:0 
excel vba语句转VB
下面一段EXCEL VBA代码请大家们帮我看看,是什么意思。。帮我解释一下也行,最好能帮我转成VB语句
Dim WST(1) As Worksheet
Dim Obj(1) As Object
Dim RNG(0) As Range
Dim Cou(0) As Integer
Dim Row(1) As Integer
Dim Col(1) As Integer

Sub Practice()

    Set WST(0) = ThisWorkbook.Sheets("Data")
    Set WST(1) = ThisWorkbook.Sheets("Result")
    Set RNG(0) = WST(0).Range("E1")
   
    Set Obj(0) = CreateObject("Shell.Application").BrowseForFolder(0, "", 0)
    If Not Obj(0) Is Nothing Then
        Set Obj(1) = CreateObject("Shell.Application").BrowseForFolder(0, "", 0)
        With Application.FileSearch
            .NewSearch
            .LookIn = Obj(0).Items.Item.Path
            .Filename = "*.csv"
            For Cou(0) = 1 To .Execute
                WST(0).Cells.ClearContents
                WST(1).Range("B3:AW14").ClearContents
               
                Workbooks.Open .FoundFiles(Cou(0))
                Workbooks(Dir(.FoundFiles(Cou(0)))).Sheets(1).Cells.Copy
                WST(0).Range("A1").PasteSpecial
                Application.DisplayAlerts = False
                Workbooks(Dir(.FoundFiles(Cou(0)))).Close SaveChanges:=False
               
                WST(1).Activate
                WST(1).Range("A1").Select


                这中间是显示内容我懂得



                WST(1).Copy
                Workbooks(Workbooks.Count).Close SaveChanges:=True, _
                Filename:=Obj(1).Items.Item.Path & "\" & _
                Left(Dir(.FoundFiles(Cou(0))), Len(Dir(.FoundFiles(Cou(0)))) - 4) & ".xls"
            Next
        End With
    End If
搜索更多相关主题的帖子: 语句 vba excel 
2009-09-16 16:18
快速回复:excel vba语句转VB
数据加载中...
 
   



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

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