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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
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
 

Forum statistics

Threads
1,141,728
Messages
5,708,130
Members
421,548
Latest member
douae

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
Top