How to Sum an Array in VBA

  Рет қаралды 921

Sean MacKenzie Data Engineering

Sean MacKenzie Data Engineering

Күн бұрын

Пікірлер: 10
@JoeyMagallanes-sc6rm
@JoeyMagallanes-sc6rm 7 ай бұрын
I love the way you split the career to basic and advanced skills. I’ve been keep doing that to become the data engineer. Thanks for sharing!
@seanmackenziedataengineering
@seanmackenziedataengineering 7 ай бұрын
You're very welcome! Good luck on your data engineering journey 🛠
@tuffley2175
@tuffley2175 8 ай бұрын
Wow I got > 20 text boxes in a user form = number type , double How can I assign those into the array please [is it need to have a variable for each] Field names are bit long and bit messy when using in a query!!
@seanmackenziedataengineering
@seanmackenziedataengineering 8 ай бұрын
If you numbered them like txtMyNumber0, txtMyNumber1, txtMyNumber2 etc then you can load them in one loop, something like: Dim intItem as Integer Dim arr(26) For intItem = 0 to 26 'say you have 27 text boxes arr(intItem) = Forms!MyForm("txtMyNumber" & intItem) Next Array is loaded! If you don't have a numbered design on your form then you can manually load: arr(0) = Forms!MyForm!txtThisField arr(1) = Forms!MyForm!txtThatField etc.
@tuffley2175
@tuffley2175 8 ай бұрын
2nd option suits me I will try that out 1st option is cleaner and simpler if new this on designing stage Bravo 🫡
@tuffley2175
@tuffley2175 7 ай бұрын
Will you kind enough to add to your “Download’ please Better to keep it in my collection 🤞
@seanmackenziedataengineering
@seanmackenziedataengineering 7 ай бұрын
@@tuffley2175 added.
@serdip
@serdip 4 ай бұрын
Very informative and helpful video. Thanks for sharing. Since VBA lacks augmented assignment operators (among other things), I created a subroutine that somewhat simplifies incrementing or decrementing a variable. I have used it hundreds of times since then and for me at least, it's pretty handy: Public Sub Incr(ByRef InputValue As Variant, ByVal Amount As Variant) '--------------------------------------------------------------------------------------- ' Procedure : Incr ' Purpose : Increments/decrements referenced variable ' : ' : '--------------------------------------------------------------------------------------- 10 On Error GoTo ErrProc 20 vntValue = vntValue + vntAmount 30 Exit Sub ErrProc: 40 MsgBox "Error " & Err.Number & " (" & Err.Description & ") at line " _ & CStr(Erl) & " in procedure Incr of Module " & m_MODULE_NAME Usage: Dim x As Integer x = 5 Incr x, 10 Debug.Print x '15 Incr x, -10 Debug.Print x '5 Thank you kindly.
@seanmackenziedataengineering
@seanmackenziedataengineering 4 ай бұрын
Cool!
Use One Function to Handle Many Form Events in MS Access
10:49
Sean MacKenzie Data Engineering
Рет қаралды 1,6 М.
10 Years of VBA Array Knowledge in 40 Mins
41:57
Excel Macro Mastery
Рет қаралды 25 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
MS Word (Question and Answer Video -2)
4:15
GURUKUL COMPUTER & EDUCATION CENTER
Рет қаралды 70
How to Use Class Modules in Microsoft Access
26:35
Sean MacKenzie Data Engineering
Рет қаралды 2 М.
Mastering Static Arrays in Microsoft Access VBA with a Dice Roll Simulator
14:56
Computer Learning Zone
Рет қаралды 2,3 М.
Python Booleans: The Truth You NEED to Know 🐍
10:41
PreCodeCamp
Рет қаралды 96
VBA For Loop - A Complete Guide
12:36
Excel Macro Mastery
Рет қаралды 85 М.
How to Pad Values in Microsoft Access
13:18
Sean MacKenzie Data Engineering
Рет қаралды 948
VBA Arrays Explained in 3 Minutes
3:44
Excel Macro Mastery
Рет қаралды 36 М.
Create Excel Workbooks Worksheets Automatically with Excel VBA Arrays
10:05
How To Master Arrays In Excel VBA + FREE MACROS & CHEAT SHEET
29:09
Excel For Freelancers
Рет қаралды 10 М.
How to Save Files in SQL Server
21:05
Sean MacKenzie Data Engineering
Рет қаралды 682
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН