Senhores Boa tarde,
Sou novato por aqui, saudações a todos.
Encontrei esse script na internet para importar dados de uma planilha fechada.
O problema é que script importa apenas o valor de uma célula, tentei adaptar para importar várias colunas e gravar em um uma outra planilha, pois preciso por exemplo das colunas "A:A,B:B,G:G,K:K,M:M,Q:Q,Z:Z,AG:AG" de um arquivo que esta fechado.
Alguém poderia me dar um help?
Antecipo agradecimentos 
Sub ReadDataFromAllWorkbooksInFolder()
Dim FolderName As String, wbName As String, cValue As Variant
Dim wbList As String, sValuePlan1 As String
'Path (Diretorio) -Ajustar o Caminho
FolderName = "C:Foldername"
'Nome do Arquivo de onde extrairemos a informação
wbName = Dir(FolderName & "" & "Teste.xls")
'Armazenamos nas Variaveis
wbList = wbName
wbName = Dir
'le o Valor no workbook
cValue = GetInfoFromClosedFile(FolderName, wbList, "Plan1", "A1")
'Msgbox com o Valor em A1
MsgBox "O Valor em A1 - Plan1 é :- " & cValue
'Armazenamos o Valor na variavel
sValuePlan1 = cValue
'Coloca o Valor na Celula
Cells(1, 1).Formula = cValue
End Sub
Private Function GetInfoFromClosedFile(ByVal wbPath As String, _
wbName As String, _
wsName As String, _
cellRef As String) As Variant
Dim arg As String
GetInfoFromClosedFile = ""
If Right(wbPath, 1) <> "" Then wbPath = wbPath & ""
If Dir(wbPath & "" & wbName) = "" Then Exit Function
arg = "'" & wbPath & "[" & wbName & "]" & _
wsName & "'!" & Range(cellRef).Address(True, True, xlR1C1)
On Error Resume Next
GetInfoFromClosedFile = ExecuteExcel4Macro(arg)
End Function
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 15/01/2014 11:57 am