-
VBA for copying values with ActiveCell.Offset
Hello all,
I´ve problem with VBA code. details is below. I want copy values with ActiveCell.Offset, but everytime I´ve error message from Excel. Please help me. Thank you guys in advance.
Sub CopyValues()
Dim InputFile As Workbook
Dim OutputFile As Workbook
Dim Inputpath As String
Dim Outputpath As String
Dim Owner As String
Dim ClaimDate As String, CustomerNo As String, PartNo As String, Description As String, finalPath As String
Dim FolderName As String, Folder As String, Path As String
Dim sDFolder As String
Path = "P:\Quality\Reklamace\2021"
Folder = ActiveCell.Offset(0, 4)
Owner = ActiveCell.Offset(0, 8)
FolderName = Selection.Value
sDFolder = Path & Folder & "" & FolderName & ""
finalPath = sDFolder & FolderName & ".xlsx"
'## Open both workbooks first:
Set InputFile = ActiveWorkbook
Set OutputFile = Workbooks.Open(finalPath)
InputFile.Activate
Application.CutCopyMode = False
InputFile.Selection(Owner).Copy
OutputFile.Range("AA1").PasteSpecial
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules