Please help me to import name range using connection [Closed]

Report
Posts
27
Registration date
Tuesday November 18, 2014
Status
Member
Last seen
May 21, 2015
-
Hello,

i have connected a worksheet-2 to worksheet-1 and in worksheet-2 i have named ranges which i want to import using the vba script is it possible to give path of 2nd file in application go to reference:
Sub RunMe()
Sheets("123").Select

For Each cell In Range("A1")
Application.Goto Reference:=(Existing Connections,worksheet-2, name range:cell.Value)
If Sheets("COMBINED").Range("A1") = vbNullString Then
Selection.Copy Sheets("COMBINED").Range("A1")
Else
Selection.Copy Sheets("COMBINED").Cells(A1, Columns.Count).End(xlToLeft).Offset(0, 1)
End If
Next cell

End Sub

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!