Tutorial by Examples

When referring to a worksheet, a range or individual cells, it is important to fully qualify the reference. For example: ThisWorkbook.Worksheets("Sheet1").Range(Cells(1, 2), Cells(2, 3)).Copy Is not fully qualified: The Cells references do not have a workbook and worksheet associated ...
If you want to delete rows (or columns) in a loop, you should always loop starting from the end of range and move back in every step. In case of using the code: Dim i As Long With Workbooks("Book1").Worksheets("Sheet1") For i = 1 To 4 If IsEmpty(.Cells(i, 1)) Then...
ActiveWorkbook and ThisWorkbook sometimes get used interchangeably by new users of VBA without fully understanding which each object relates to, this can cause undesired behaviour at run-time. Both of these objects belong to the Application Object The ActiveWorkbook object refers to the workbook ...
Be aware that Microsoft Excel 2013 (and higher) uses Single Document Interface (SDI) and that Excel 2010 (And below) uses Multiple Document Interfaces (MDI). This implies that for Excel 2013 (SDI), each workbook in a single instance of Excel contains its own ribbon UI: Conversely for Excel...

Page 1 of 1