praveenpatel421983
New Member
- Joined
- Aug 17, 2017
- Messages
- 41
Hi all,
I am trying to copy a range from a sheet called "Test" of active workbook to existing workbook in which a sheet called "Test" (which already exists) but I am not able to copy. Please help.
Application.ScreenUpdating = False
Dim parentWorkbook As Excel.Workbook
Dim otherWorkbook As Excel.Workbook
Dim workbookName As Variant
Set parentWorkbook = ActiveWorkbook
workbookName = "C:\New Microsoft Excel Worksheet.xlsx"
If Not workbookName = False Then
Set otherWorkbook = Workbooks.Open(workbookName)
otherWorkbook.Sheets("Test").Range("A1:G1000").Value = parentWorkbook.Sheets("Test").Range("A1:G1000").Value
otherWorkbook.Close False
Set otherWorkbook = Nothing
End If
Application.ScreenUpdating = True
I am trying to copy a range from a sheet called "Test" of active workbook to existing workbook in which a sheet called "Test" (which already exists) but I am not able to copy. Please help.
Application.ScreenUpdating = False
Dim parentWorkbook As Excel.Workbook
Dim otherWorkbook As Excel.Workbook
Dim workbookName As Variant
Set parentWorkbook = ActiveWorkbook
workbookName = "C:\New Microsoft Excel Worksheet.xlsx"
If Not workbookName = False Then
Set otherWorkbook = Workbooks.Open(workbookName)
otherWorkbook.Sheets("Test").Range("A1:G1000").Value = parentWorkbook.Sheets("Test").Range("A1:G1000").Value
otherWorkbook.Close False
Set otherWorkbook = Nothing
End If
Application.ScreenUpdating = True