Advice for a novice

Paddy1979

Well-known Member
Joined
Sep 23, 2005
Messages
608
Hello i have just written the below code, and i was wondering is there a quicker/easier way to write the same code ?

Worksheets("Summary").Activate
With ActiveSheet

.Range("F98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("G98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("H98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("I98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("J98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("K98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("N98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("O98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("P98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("Q98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("L98").Value = "=IF(RC[-6]<1,0,RC[-6]/RC[-1])"
.Range("M98").Value = "=IF(RC[-7]<1,0,RC[-7]/(RC[-2]-RC[-3]))"

cheers
patrick
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hello,

How about

Code:
Worksheets("Summary").Activate
With ActiveSheet
.Range("F98:Q98").Value = "=SUMIF(R2C4:R96C4,""D"",R2C:R96C)"
.Range("L98").Value = "=IF(RC[-6]<1,0,RC[-6]/RC[-1])"
.Range("M98").Value = "=IF(RC[-7]<1,0,RC[-7]/(RC[-2]-RC[-3]))"
End With
 
Upvote 0

Forum statistics

Threads
1,214,660
Messages
6,120,787
Members
448,994
Latest member
rohitsomani

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