From the course: Excel VBA: Managing Files and Data
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Check if a worksheet exists - Microsoft Excel Tutorial
From the course: Excel VBA: Managing Files and Data
Check if a worksheet exists
- [Narrator] Mine of the fundamental operations that you'll perform using Excel VBA, is to check whether a worksheet exists. In this movie, I will demonstrate the code that will let you do that, my sample file is 0301 sheet exists, and that's a macro enabled Workbook you can find in the chapter three folder of the exercise files collection, I have three worksheets, and this Workbook I won't be working directly with the date in any of them. So I'll press Alt F 11, to move over to the Visual Basic Editor, And here, I have two code modules that contain procedures. The first is a function, that's what you see here with the name worksheet exists. I'll describe what to do with the function in a moment, but I want to go down to the sub routine below, called check for sheet. And what this does, is determine whether there is in fact a worksheet of a given name. So you've got the declaration for the subroutine at the top,…
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
-
-
-
-
-
Check if a worksheet exists5m 11s
-
Create and rename worksheets5m 28s
-
Copy a worksheet within the active workbook4m 20s
-
Copy a worksheet to a new workbook3m 58s
-
Copy a worksheet to an existing workbook5m 47s
-
Move a worksheet within the active workbook3m 15s
-
Move a worksheet to a new workbook4m 41s
-
Move a worksheet to an existing workbook6m 24s
-
-
-
-
-
-