Please help! I want to insert formula instead of value using cell reference by loop

Mayank07

New Member
Joined
Oct 3, 2009
Messages
2
Hello everyone

I want to insert formula instead of values, using cell reference, by applying loop across columns. Actually the main problem is that I have both the number of rows and columns variable (i mean user input), hence as a result of that these three things, no. of rows, no. of columns and starting point(row wise)of the table are dependent on initial value( say x and y, given by user)

Therefore I can't use RC reference, As we can not use variables(here x and y) in RC reference (can't use R[x]C[y]), where as I can use Cells(x,y). I want to calculate square root of values given in two column (i.e. sqrt ((A(1,1)*B(1,1))^2 + (A(2,1)*B(2,1))^2 + ....... + (A(x,1)*B(x,1))^2 = B(x+2,1) (Say)

here in it I want to apply loop for other columns till it reaches to y


Please help me out and excuse me if it is a very simple or obvious question as I am new to VBA programing.


Thanks
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Sorry It would be better if I write this way

Hello everyone

I want to insert formula instead of values, using cell reference, by applying loop across columns. Actually the main problem is that I have both the number of rows and columns variable (i mean user input), hence as a result of that these three things, no. of rows, no. of columns and starting point(row wise)of the table are dependent on initial value( say x and y, given by user)

Therefore I can't use RC reference, As we can not use variables(here x and y) in RC reference (can't use R[x]C[y]), where as I can use Cells(x,y). I want to calculate square root of values given in two column (i.e. sqrt ((Cells(1,1)*Cells((x+1),1))^2 + (Cells(2,1)*Cells((x+2),1))^2 + ....... + (Cells(x,1)*Cells((x+x),1))^2 = Cells((2x + 1),1) (Say)

here in it I want to apply loop for other columns till it reaches to y


Please help me out and excuse me if it is a very simple or obvious question as I am new to VBA programing.


Thanks
 
Last edited:
Upvote 0
Your question is not clear. If I enter 1 to 13 in column A and drag the following formula down from B1:
=(A1*A2)^2
and then enter the following to C1:
=SQRT(SUM(B:B))
is this the answer you expect (271.1605)?
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,352
Members
449,080
Latest member
Armadillos

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