##### Well-known Member
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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hello,

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``````

cheers mate

Replies
1
Views
222
Replies
4
Views
467
Replies
7
Views
623
Replies
2
Views
2K
Replies
3
Views
685

1,219,892
Messages
6,150,800
Members
450,985
Latest member
Andynair7

### 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.

### Which adblocker are you using?

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

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