0

我有下面的代码,我需要从“A:K”范围内的表中导入数据。

Function ImportExport(ByVal template As String) As Boolean

    Dim Name As String
    Dim Code As String
    Dim table As String
    Dim Sheet As String
    
    If Dir(CurrentProject.Path & "\Folder1\*" & template & "*") = "" Then ImportExport = True
        Else
    Name = Dir(CurrentProject.Path & "\Folder1\*" & template & "*")
            
     Select Case template
                Case “Reality
                Code = “Try1”
                table = “secondTable"
                
                'Sheet = Sheets("Table_needs!”).Range("A:K")
                Sheet = "Table_needs!"

我需要的是这样的:

Sheet = Sheets("Table_needs!”).Range("A:K")

但它在这种结构中不起作用。谁能帮忙?

4

0 回答 0