From the course: Excel VBA: Managing Files and Data
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Move a worksheet to a new workbook - Microsoft Excel Tutorial
From the course: Excel VBA: Managing Files and Data
Move a worksheet to a new workbook
- When you manage files in Excel VBA, there will be times when you want to cut a worksheet from a workbook and move it to a new workbook. In this movie, I will show you how to do that. My sample file is 0307, moved to new, and it's an Excel macro enabled workbook that you can find in the chapter three folder of the exercise files collection. I have three worksheets in this workbook and we'll be working with January. This is the one that is currently showing. I don't need to work with any of the data, so I'll press alt F11 to move to the visual basic editor. And you can see here that I have a code module open with the outline of a sub routine called move to new. So I'll press the down arrow twice and I can start adding my code. The code to move a worksheet, that is, cut it from one workbook and move it to another, is straightforward. All you need to do is select the worksheet and then tell it to move. So that first line…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Check if a worksheet exists5m 11s
-
Create and rename worksheets5m 28s
-
(Locked)
Copy a worksheet within the active workbook4m 20s
-
(Locked)
Copy a worksheet to a new workbook3m 58s
-
(Locked)
Copy a worksheet to an existing workbook5m 47s
-
Move a worksheet within the active workbook3m 15s
-
(Locked)
Move a worksheet to a new workbook4m 41s
-
(Locked)
Move a worksheet to an existing workbook6m 24s
-
(Locked)
-
-
-
-
-