• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

RuntimeError 9, Subscript Out of range

Ashhu

Active Member
Dear Friends

Please help me here,
I am trying to copy data from one workbook to another.

the source workbook from where i copy , i have option to choose and
the destination folder workbook name is dynamic, so i save the file name and call in code.

but it turns out to be some issue while i call for it and show up error.

need help to locate prob.

Code:
Sub RetrieveFileName()

Dim sFileName As String
Dim Destination As String

Destination = ActiveWorkbook.FullName

sFileName = Application.GetOpenFilename
Workbooks.Open sFileName
Worksheets("Consolidated").Activate

ActiveSheet.Range("A1").CurrentRegion.Copy Destination:=Workbooks(Destination).Worksheets("Sheet1").Range("a1")
 

Hi !

As we can't obviously guess « some issue » (we are not mind readers !)
so first check yourself the codeline where error occurs …
 
Back
Top