Se você está recebendo este erro:
éporcausado*
nonomedoarquivo-substitua-opelaletraexataemseunomedearquivo
.
Tenteisto:
PublicSubTransposeInfoBetweenFiles()DimmySourceAsStringDimmyDestAsStringDimwbkWorkbook1AsWorkbookDimwbkWorkbook2AsWorkbook'DefinepathandfilenamemySource="C:18\CustSvy001.xlsx" '<- Replaced "*" with "x" or "m"
myDest = "C:18\CustResults.xlsx" '<- This is Ok (exact path and file name)
Application.ScreenUpdating = False
'Open files
Set wbkWorkbook1 = Workbooks.Open(mySource)
Set wbkWorkbook2 = Workbooks.Open(myDest)
'Select items to transpose
wbkWorkbook1.Worksheets("Q8").Range("B8:B11").Copy
wbkWorkbook2.Worksheets("New").Range("G6").PasteSpecial Paste:=xlPasteAll, _
SkipBlanks:=False, Transpose:=True
'Close the two workbooks
wbkWorkbook1.Close True
wbkWorkbook2.Close True
Application.ScreenUpdating = True
End Sub