Home |
Search |
Today's Posts |
#16
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey thanks this is the exact one ,Im trying to modify the values of this code
"C = Cl + 2 - (Cl + 1) Mod 3" so it will compute after 3 columns. but I cant get the exact value. Need help thanks. Jay "Dana DeLouis" wrote: C = 3 * Int((Cl + 4) / 3) - 2 Slightly better might be just an offset equation... Sub Try2() Dim Rw As Long Dim Cl As Long Dim C As Long Rw = ActiveCell.Row Cl = ActiveCell.Column If Not (Rw = 2 And Rw <= 12 And _ Cl = 2 And Cl <= 22) Then Exit Sub '// Offset by 2,1,or 0 C = Cl + 2 - (Cl + 1) Mod 3 '// Fill in Formula down to row 12 Range(Cells(Rw, C), Cells(12, C)).FormulaR1C1 = "=RC[-2]+RC[-1]" End Sub - - - HTH :) Dana DeLouis |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I Make This Computation Shorter? | Excel Discussion (Misc queries) | |||
Shorter Code | Excel Programming | |||
How to make a contingent formula shorter... | Excel Discussion (Misc queries) | |||
I wonder if you can make this shorter | Excel Worksheet Functions | |||
Shorter code | Excel Programming |