Advanced Excel VBA Code

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:06 PM on 5/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

12 Terms

1
New cards

LastRow = Cells(Rows.Count, X).End(xlUp).Row

Look at column X in the spreadsheet, find the last row that has data in it, and that's your LastRow value

2
New cards
<p>LastRow = Cells(Rows.Count, 1).End(xlUp).Row. What’s the last row that has data in the excel spreadsheet?</p>

LastRow = Cells(Rows.Count, 1).End(xlUp).Row. What’s the last row that has data in the excel spreadsheet?

Row 11

3
New cards
<p>Cells(Rows.Count, 1).End(xlUp).Row - 2</p>

Cells(Rows.Count, 1).End(xlUp).Row - 2

Subtract the difference of the last row that has data in it by 2. In this problem. Last row is 13, so you’d do 13-2= 11. Now the LastRow is 11. Loop will run from rows k=3 to k=11.

4
New cards
<p>Cells (K,X)</p>

Cells (K,X)

X is telling you which column # you should look for.

5
New cards
<p>After Loop is ran the 2nd time, the variable of tot_k will be…</p>

After Loop is ran the 2nd time, the variable of tot_k will be…

Round

k (row)

Exam No (col 1)

Sick Days (col 4)

Condition (OR)

What gets added

tot_k

1st

3

1

10

1=6? No. 10=10? Yes → TRUE

Sick Days = 10

10

2nd

4

2

10

2=6? No. 10=10? Yes → TRUE

Sick Days = 10

20

6
New cards
<p>How to find the “Total Is” Column?</p>

How to find the “Total Is” Column?

Cells(LastRow + 4, 2).Value = "The Total is."

Ans: ,2= Column B

7
New cards
<p>What does the term “Not False” evaluate to?</p>

What does the term “Not False” evaluate to?

It tells you what is True. “If Not” tells you it’s not false that 2<1. Hence the message box. “Today is Friday” will pop up!

8
New cards

In Cells(k, 4), what does k tell you?

K tells you where the row is.

9
New cards

When the loop says For k = 3 To LastRow, what row is k on during the 2nd loop?

Row 4 (starts at 3, increments by 1)

10
New cards

What is the default value of an Integer variable before anything is assigned to it?

Zero

11
New cards

If the condition uses And and one part is False, what happens?

Goes to Else — both must be True for Then to run

12
New cards

If the condition uses Or and only one part is True, what happens?

Runs Then — only one needs to be True