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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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,229
Messages
6,170,881
Members
452,364
Latest member
springate

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