Does any of you suckers know VBA?

does any of you suckers know VBA?
i'm a total tool and need to write a program.

Other urls found in this thread:

youtube.com/watch?v=R-o7YG3x0DI
twitter.com/AnonBabble

you better start googling faggot

last time I fucked around with VB it was 2000 (VB.NET doesn't count, now or ever)

fuck, is this shit even hard?

I am on the case OP, don't worry. Keep the thread alive with pictures of your tits.

but i'm a woman you faggot. You sure you want them?

Oh hell naw, fuck you then.

i can google some nice boy tits if you wish?

Just your asshole will be fine

Dim numbers() As Double, temp As Double, sum As Double, counter As Integer
sum = 0
counter = 0
Do until temp = 0
temp = InputBox("Type in a positive number less than 100.")
If temp > 0 && temp < 100
ReDim Preserve numbers(0 to counter)
numbers(counter) = temp
End If
Counter = Counter + 1
Loop

Dim i as Integer
i = 0

For i = 0 To UBound(numbers)
If numbers(i) MOD 2 == 0
sum = sum + numbers(i)
Next i

MsgBox sum

I don't have excel, so test this out if you have it.

>If temp > 0 && temp < 100
it says syntax error, hmmmm

oh and also, thank you so much.
here's a booty of a local girl for you

replace && with the word AND

expected word then or goto

Why the fuck would you need to do this? What kind of outdated job are you prepping for faggot?

i'm not sure also, my college is wierd

add Then after the if condition

Also, I remembered OpenOffice uses a BASIC language, so I am able to fix the code I wrote above.

This works on OpenOffice, so I hope it now works on Excel too.

Dim numbers() As Double, temp As Double, sum As Double, counter As Integer
sum = 0
counter = 0
temp = -1
Do until temp = 0
temp = InputBox("Type in a positive number less than 100.")
If temp > 0 AND temp < 100 Then
ReDim Preserve numbers(0 to counter)
numbers(counter) = temp
End If
Counter = Counter + 1
Loop

Dim i as Integer
i = 0

For i = 0 To UBound(numbers)
If numbers(i) MOD 2 = 0 Then
sum = sum + numbers(i)
Next
Next
MsgBox sum

I just realised why I needed the two "Next" at the bottom to make it work, I forgot to exit the If statement.

Just replace the first of the two "Next" at the bottom with "End If".

It works now. the hard part is done, now need to research what every line does.
this thread can die in pain now. thank you kind sir.

I can explain what I did if you want.

that's asking for too much, but if you have free time and willing to please do

I have got nothing better to do.

Which parts do you want me to explain?

>ReDim Preserve numbers(0 to counter)
>numbers(counter) = temp
>End If
>Counter = Counter + 1

>Dim i as Integer
>i = 0
>For i = 0 To UBound(numbers)
>If numbers(i) MOD 2 = 0 Then
>sum = sum + numbers(i)
i know some of the lines, but no idea what redim preserve and ubound lines do

>>ReDim Preserve numbers(0 to counter)
Because the size of the array needed to store the valid inputs is unpredictable, I used "ReDim" to resize the array so that after each number is input, the program creates an extra space in the array for the last input. The "Preserve" after the ReDim is to simply preserve the contents of the array after it is resized, otherwise all elements get wiped out.

>>numbers(counter) = temp
This line is assigning the last input (temp) to the last index in the array. The counter variable keeps track of how many inputs have already been entered and the size of the array.

>>Counter = Counter + 1
This is just preparing the variable to count the next input. It is a common thing to do in loops.

>>Dim i as Integer
>>i = 0
Declaring the counting variable for the loop. In other programs you can do this directly in the loop.

>>For i = 0 To UBound(numbers)
The loop will sum over all of the elements in the array (Note: Indexes start at zero typically). UBound is the index of the last element in the array (again, needed because of the unpredictable size of the array)

>>If numbers(i) MOD 2 = 0 Then
This is checking if the element in the array is even. the MOD function returns the remainder of a number, in this case, the inputs in the array. If the remainder is 0 when divided by 2, then the number is even.

>>sum = sum + numbers(i)
The sum of the valid numbers is stored in "sum". If the input is even, then it is added to "sum".

>In other programs you can do this directly in the loop.

I meant programming languages.

This is one of those rare times where people on Sup Forums are nice, intelligent, and helpful. Tis' a beautiful sight. 2017 Lookin good!

is this for an MBA? is this for a 3 week winter semester? wow.

i want to shove a recursive binary search tree in C up your ass.

youtube.com/watch?v=R-o7YG3x0DI

no, it's a full college. i'm just living in a shithole country