MENU

Fun & Interesting

The Ultimate Guide to Copying Data using Excel VBA

Excel Macro Mastery 76,016 3 years ago
Video Not Working? Fix It Now

Learn how to write real-world Excel VBA code: 👉https://courses.excelmacromastery.com/ Want to download the source code for this video? Go here: https://bit.ly/3cflkjT Subscribe to the channel here: https://bit.ly/36hpTCY The Ultimate Guide to Copying Data using Excel VBA In this video I'm going to cover everything you need to know about copying data using VBA. We're going to look at: * What to avoid * How to ensure your code runs fast * How to get the correct worksheet every time * An in-depth look at the 4 methods * The pros and cons of each method #excelvba #excelvbacopy #ExcelVBAArray #ExcelVBAAdvancedFilter #ExcelVBAADO YouTube Video: How to use ADO and VBA to Read from Worksheets: https://youtu.be/L0I24NGrUtc YouTube PlayList: Excel VBA Copying and Filtering Data: https://youtube.com/playlist?list=PL7ScsebMq5uV493VqnVEIY35SKxUKwWHM YouTube PlayList: Excel VBA Arrays: https://youtube.com/playlist?list=PL7ScsebMq5uV493VqnVEIY35SKxUKwWHM Useful VBA Shortcut Keys ======================== Debugging: Compile the code: Alt + D + L OR Alt + D + Enter Run the code from the current sub: F5 Step into the code line by line: F8 Add a breakpoint to pause the code: F9(or click left margin) Windows: View the Immediate Window: Ctrl + G View the Watch Window: Alt + V + H View the Properties Window: F4 Switch between Excel and the VBA Editor: Alt + F11 View the Project Explorer Window: Ctrl + R Writing Code: Search keyword under cursor: Ctrl + F3 Search the word last searched for: F3 Auto complete word: Ctrl + Space Get the definition of the item under the cursor: Shift + F2 Go to the last cursor position: Ctrl + Shift + F2 Get the current region on a worksheet: Ctrl + Shift + 8(or Ctrl + *) To move lines of code to the right(Indent): Tab To move lines of code to the left(Outdent): Shift + Tab Delete a Line: Ctrl + Y(note: this clears the clipboard) Table of Contents: 00:00 - Introduction 00:26 - Don't do this 01:06 - Speeding up your code 02:16 - Get the correct worksheet every time 02:31 - How to get the correct worksheet 05:45 - How to get the correct data range 07:11 - Method 1: For Loop & Range 12:38 - Method 2: For Loop - Arrays 16:26 - Method 3: Advanced Filter 26:40 - Method 4: ADO

Comment