How do I use values i have calculated and output to rows again in another formula, in VBA:(

KatieLarson

New Member
Joined
Feb 7, 2013
Messages
4
Okay I have used a loop to calculate values for x and y and displayed both in seperate columns. I have put x in a column starting f2 and y in a column starting g2 how then do i then input these coordinates to another formula. It is to calculate the angle of a robot arm, the formula is (x^2 +y^2 -l1^2 - l2^2)/(2*l1*l2) i could input these into this no problem but only once. How do extract these coordinates and put them into the formula as many times as required??

Would love any kind of help some help :)

oh and this is what my loop looks like

For i = 0 To pointscir
Range("f" & i + 2) = ((r * (Cos((2 * Pi) * numpcir * i))) + a)
Range("g" & i + 2) = ((r * (Sin((2 * Pi) * numpcir * i))) + b)
Next i
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
What do you mean by:
"How do extract these coordinates and put them into the formula as many times as required??"
Do you want to calculate sequential x & y positions of the arm so that the new position you obtain is fed into the formula?
What do you want as a result?
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top