This is my code:
Sub FillInternetForm()
Dim fromPath As String
Dim toPath As String
fromPath = InputBox(prompt:="Enter FROM File FULL Path:", _
Title:="FROM FILE", Default:="")
toPath = InputBox(prompt:="Enter TO File FULL Path:", _
Title:="TO FILE", Default:="")
Workbooks(fromPath).Sheets("Sheet1").Range("F10").Copy
Workbooks(toPath).Sheets("Sheet1").Range("F10").PasteSpecial
End Sub
I have 3 Workbooks (Macros.xlsm, CopyFrom.xlsx and CopyTo.xlsx). The above code is stored in Module 1 on the Macros.xlsm workbook.
Workbooks (CopyFrom.xlsx and CopyTo.xlsx) are already open...
What I need to do is: Copy value in cell (F10) from CopyFrom.xlsx workbook to cell (F10) in CopyTo.xlsx workbook...
I keep getting the following Error: "Subscript out of range"
Any help is appreciated!
worksheetsinstead ofsheetsbut uh why do you need to prompt for names if you already know which books they are? Edit: if you don't need formatting just set the ranges to each other instead of copy paste. - findwindow