filmov
tv
Excel Macros & VBA: 3 Learn simple Excel VBA using the Macro Recorder

Показать описание
// FREE Excel E-book "Record Your First Macro"
// Recommended Excel Courses //
// Recommended Excel Templates //
If you are looking for pre-built, easy to use spreadsheets, check out Simple Sheets.
They have Excel templates covering cash flow planning, invoices, expense reports, personal budgets, and more!
——
// EPISODE NOTES
In episode 3 I will:
▸ Reveal that the Macro Recorder tool can be used to learn simple Excel VBA
▸ Demonstrate the types of Excel statements the Macro Recorder can write
▸ Explain what the Excel Macro Recorder cannot do for you
▸ You will learn how easy it is to start writing Macros to automate Microsoft Excel.
——
// LEARN MACROS WITH LAUNCH EXCEL
Most Excel users never start using Macros because they either haven't heard of them, or feel overwhelmed because they think it's all too hard. This is a shame because Macros and VBA can give you Excel superpowers.
You can save vast amounts of time by automating repetitive tasks and even create your own new functionality to do things that Excel does not do by itself.
But... it sometimes looks like Excel Macros are so technical. Don't worry, in this video I show you that the Macro Recorder tool can be a good friend for learning the Macro language of VBA (Visual Basic for Applications)
——
// VISIT MY WEBSITE
- - - - - - - - - -
Extra Notes
- - - - - - - - - -
1. You can access the VBA Editor using the shortcut key combination ALT + F11
2. To step line-by-line through your macros in the VBA Editor use the keyboard shortcut F8
3. Here is the sample code for two worksheet event handlers. It's here for entertainment purposes only. Please use cautiously, and remember to keep backups of your documents before you run macros on them.
You need to copy and paste these into worksheet modules, not code modules.
When you want to stop them, just delete the code from the module. Or comment it out using the apostrophe (‘) at the start of a line. Excel will skip over comment lines that start with an apostrophe (‘)
------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim i As Integer
i = Target.Interior.ColorIndex
Select Case i
Case -4142
i = 1
Case 0 To 55
i = i + 1
Case Is > 55
i = 0
End Select
Target.Interior.ColorIndex = i
End Sub
---------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 1 'black
End Sub
// Recommended Excel Courses //
// Recommended Excel Templates //
If you are looking for pre-built, easy to use spreadsheets, check out Simple Sheets.
They have Excel templates covering cash flow planning, invoices, expense reports, personal budgets, and more!
——
// EPISODE NOTES
In episode 3 I will:
▸ Reveal that the Macro Recorder tool can be used to learn simple Excel VBA
▸ Demonstrate the types of Excel statements the Macro Recorder can write
▸ Explain what the Excel Macro Recorder cannot do for you
▸ You will learn how easy it is to start writing Macros to automate Microsoft Excel.
——
// LEARN MACROS WITH LAUNCH EXCEL
Most Excel users never start using Macros because they either haven't heard of them, or feel overwhelmed because they think it's all too hard. This is a shame because Macros and VBA can give you Excel superpowers.
You can save vast amounts of time by automating repetitive tasks and even create your own new functionality to do things that Excel does not do by itself.
But... it sometimes looks like Excel Macros are so technical. Don't worry, in this video I show you that the Macro Recorder tool can be a good friend for learning the Macro language of VBA (Visual Basic for Applications)
——
// VISIT MY WEBSITE
- - - - - - - - - -
Extra Notes
- - - - - - - - - -
1. You can access the VBA Editor using the shortcut key combination ALT + F11
2. To step line-by-line through your macros in the VBA Editor use the keyboard shortcut F8
3. Here is the sample code for two worksheet event handlers. It's here for entertainment purposes only. Please use cautiously, and remember to keep backups of your documents before you run macros on them.
You need to copy and paste these into worksheet modules, not code modules.
When you want to stop them, just delete the code from the module. Or comment it out using the apostrophe (‘) at the start of a line. Excel will skip over comment lines that start with an apostrophe (‘)
------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim i As Integer
i = Target.Interior.ColorIndex
Select Case i
Case -4142
i = 1
Case 0 To 55
i = i + 1
Case Is > 55
i = 0
End Select
Target.Interior.ColorIndex = i
End Sub
---------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 1 'black
End Sub
Комментарии