Excel VBA Introduction Part 8 - Variables
Why Stack Overflow recommends it
Stack Overflow users link it when answering beginners who need a grounding in VBA variables, data types and scope.
Recommended by 2 people across 2 different months, 2016 to 2018.
What it is
A 37-minute beginner tutorial from Wise Owl's Excel VBA Introduction series, presented by Andrew Gould. It covers declared versus undeclared variables, choosing data types, what happens when you pick the wrong one, and variable scope within subroutines.
What people said
Recommends user6432984 · 2016-07 · Stack Overflow · on “How to create dynamic variable names VBA”
This will get you started. But before you start I recommend watching these WiseOwlTutorials tutorial on Youtube: Selecting Cells (Range, Cells, Activecell, End, Offset) [LINK] Worksheets, Charts and Sheets [LINK] Variables [this video] Arrays [LINK] Dim i, x As Integer x = Range("J4").Value Dim Team() As Integer Dim Manager() As String ReDim Team(1 To x) As Integer ReDim Manager(1 To x) As String Range("A3").Select For i = 1 To x Team(i) = i Next
Recommends TinMan · 2018-12 · Stack Overflow · on “How to reference cell "A(x.Value)" where x is an Integer that goes from 1 until "A(x.Value)" = NULL”
Integers are not Objects in VBA. If Workbooks("Training_TEST").Sheets(2).Range("A" & x) = Null Then You should watch Excel VBA Introduction [LINK] video series on YouTube. Here are some relevant videos: Excel VBA Introduction Part 8 - Variables [this video] Excel VBA Introduction Part 9 - Object Variables [LINK] Excel VBA Introduction Part 5 - Selecting Cells (Range, Cells, Activecell, End, Offset) [LINK]
Cites Sukumar · 2018-01 · Stack Overflow · on “How to use Public variable to stop execution of VBA code”
This VBA code [LINK] was written to break password of any VBA Project. It is explained here [this video] that Public variables retain their values even after execution of VBA module. Is it possible that following VBA code (stored at Module Level or Class Level) be modified in such a way to prevent execution of (aforesaid VBA code) breaking of Project password? :- Public Dim HookBytes(0 To 5) As Byte Dim OriginBytes(0 To 5) As Byte Dim pFunc As LongPtr Dim Flag As Boolean ReDim HookBytes(0) As Byte ReDim OriginBytes(0) As Byte pFunc = 9223372036854775807 ' [LINK] Flag = True