Hi All,
Could anyone help me out with this? Here is the VBA:
Sub ImportData()
Dim rngFullName As Range
Dim wbData As Workbook
Dim wsDataCtrl As Worksheet
Dim wbOpen As Workbook
Dim wsOpen As Worksheet
Dim wsDataName As String
Application.ScreenUpdating = False
Set wbData = ThisWorkbook
Set wsDataCtrl = wbData.Sheets("Control")
Set rngFullName = wsDataCtrl.Range("H3")
Set wbOpen = Workbooks.Open(rngFullName, UpdateLinks:=False)
Set wsOpen = wbOpen.Sheets("DATABASE 1")
wsOpen.Activate
Range("A3:Z10").Select
Selection.Copy
Windows("ANALYSIS.xls").Activate
Set wsDataName = Range("H6").Value
Sheets(wsDataName).Activate
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
wbOpen.Close False
End Sub
Analysis.xls is workbook B and I need to copy the data from workbook A to workbook B's specific worksheet as indicated in cell H6. I have already pre-defined a few worksheets and H6 will show the worksheet name upon data importing. But, I couldn't get excel to copied the data to the specify worksheet and it has to be dynamic as mention.
Hope you guys can help.
Thank you
Justin
Bookmarks