I have the code below and I need to import the data from a table in the range of "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!"
What I need is sth like it:
Sheet = Sheets("Table_needs!”).Range("A:K")
But it doesn't work in this structure. can anyone help?