Formula for one Row Ok. but for range require syntax

SamDsouza

Board Regular
Joined
Apr 16, 2016
Messages
205
Hello
if my formula looks like this
Code:
With ws
.Range("CU" & curRow).Formula = "=CT" & curRow & "-CI" & curRow & "-CJ" & curRow
End With
then how can i Represent the above with below range
Code:
With ws
.Range("CU3" & ":CU" & lastRow).Formula = [COLOR=#ff0000][B]"=CT3" & ":CT" & lastRow & "-CI3" & ":-CI" & lastRow & "-CJ3" & ":-CJ" & lastRow[/B][/COLOR]

'Marked in red gave error

End With
Thanks
Samd
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Just use the formula as it would be in the first row:

Code:
Ws.Range("CU3:CU" & lastRow).Formula = "=CT3-CI3-CJ3"
 
Upvote 0
RoryA thanks for immediate response
Code:
Ws.Range("CU3:CU" & lastRow).Formula = "=CT3-CI3-CJ3"

with the above syntax you provided. Will the values be same for full range or will it update.
Will yours update CT4- CI4-CJ4
CT5-CI5-CJ5
 
Last edited:
Upvote 0
It updates just as if you did it manually. Quicker to try it... ;)
 
Upvote 0
Yes Tried : Great :)

I thought i might have to put For Next Loop for what i wanted. But you saved me from looping.
Real Amazing

Thank you so much
SamD
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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