lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I wrote a code to move a sheet from one workbook to another, please see below. It did work but it will move from workbook1 to workbook2. Can I move it and keep the copy in the workbook1. Same as if i do it manually by pressing CTRL and drag and drop the sheet. Thanks you so much.
Sub sheetmovetodifferentworkbook()
Dim x As Integer
x = InputBox("enter sheet#")
ThisWorkbook.Worksheets(x).Move before:=Workbooks(2).Worksheets(1)
End Sub
I wrote a code to move a sheet from one workbook to another, please see below. It did work but it will move from workbook1 to workbook2. Can I move it and keep the copy in the workbook1. Same as if i do it manually by pressing CTRL and drag and drop the sheet. Thanks you so much.
Sub sheetmovetodifferentworkbook()
Dim x As Integer
x = InputBox("enter sheet#")
ThisWorkbook.Worksheets(x).Move before:=Workbooks(2).Worksheets(1)
End Sub