recently began to study VBA Excel and ran into a problem. Actually, the task in the title. Here is my solution, but displays the result incorrectly (only for x = 4). Oh yeah, I know that there are many chips in all programming languages, but it is necessary to decide that it is necessary to decide only from what I studied according to the program.
Here is the “decision”
sub n6 ()
Dim X AS Single, Y As Single, I AS Single
For x = (-4) to 4 STEP 0.5
For i = 1 to 10 Step 1
Cells (I, 1) = x
Cells (I, 2) = Y
NEXT I.
y = (0.5 * (x) ^ 2) - 7 * x
NEXT X.
End Sub.
Hope someone will answer D: (P.S. Yes, I’m a beginner kettle, do not beat)
Answer 1
sub n6 ()
Dim X As Single, I AS Integer
For x = (-4) to 4 STEP 0.5
i = i + 1
Cells (I, 1) = x
Cells (I, 2) = 0.5 * x ^ 2 - 7 * x
NEXT X.
End Sub.