Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply a R1C1 function to a specific range
Hi!
I use the following function: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=RC[-2]/RC[10]" I would to modify the formula to apply it only when RC[-2] is greater than 0. Thank you! Alex -- Alex St-Pierre |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply a R1C1 function to a specific range
Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 =
"=IF(RC[-2]0,RC[-2]/RC[10],"""")" -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Alex St-Pierre" wrote in message ... Hi! I use the following function: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=RC[-2]/RC[10]" I would to modify the formula to apply it only when RC[-2] is greater than 0. Thank you! Alex -- Alex St-Pierre |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply a R1C1 function to a specific range
It works well but I'm wondering if there is way to put the condition inside
the selection of the Range. By this way, there will not have formula when not needed. Thank you! Alex -- Alex St-Pierre "Bob Phillips" wrote: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=IF(RC[-2]0,RC[-2]/RC[10],"""")" -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Alex St-Pierre" wrote in message ... Hi! I use the following function: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=RC[-2]/RC[10]" I would to modify the formula to apply it only when RC[-2] is greater than 0. Thank you! Alex -- Alex St-Pierre |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply a R1C1 function to a specific range
Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 =
"=IF(RC[-2]0,RC[-2]/RC[10],"""")" Range(Cells(i, 13), Cells(i, 500)).Value = Range(Cells(i, 13), Cells(i, 500)).Value -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Alex St-Pierre" wrote in message ... It works well but I'm wondering if there is way to put the condition inside the selection of the Range. By this way, there will not have formula when not needed. Thank you! Alex -- Alex St-Pierre "Bob Phillips" wrote: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=IF(RC[-2]0,RC[-2]/RC[10],"""")" -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Alex St-Pierre" wrote in message ... Hi! I use the following function: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=RC[-2]/RC[10]" I would to modify the formula to apply it only when RC[-2] is greater than 0. Thank you! Alex -- Alex St-Pierre |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Apply a R1C1 function to a specific range
Hi Bob,
I would like to let the formulas in the cells when RC[-2] is greater than 0. So, when RC[-2] is empty, I don't want to show a formula. The result of RC[-2]/RC[10] = #DIV/0 when RC[-2] equal to 0. Is it possible to reach the non empty cells of the column RC[-2] using something like: Set rng = wks2.Rows(1).Find(What:="SSN", LookAt:=xlWhole) Then, I could offset the range to RC[2] and apply the formula on the selected cells range only. Or is there a SpecialCells function that allow the selection of non empty cells only? like: Selection.SpecialCells(xlCellTypeBlanks).Select Thanks a lot! Alex -- Alex St-Pierre "Bob Phillips" wrote: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=IF(RC[-2]0,RC[-2]/RC[10],"""")" Range(Cells(i, 13), Cells(i, 500)).Value = Range(Cells(i, 13), Cells(i, 500)).Value -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Alex St-Pierre" wrote in message ... It works well but I'm wondering if there is way to put the condition inside the selection of the Range. By this way, there will not have formula when not needed. Thank you! Alex -- Alex St-Pierre "Bob Phillips" wrote: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=IF(RC[-2]0,RC[-2]/RC[10],"""")" -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Alex St-Pierre" wrote in message ... Hi! I use the following function: Range(Cells(i, 13), Cells(i, 500)).FormulaR1C1 = "=RC[-2]/RC[10]" I would to modify the formula to apply it only when RC[-2] is greater than 0. Thank you! Alex -- Alex St-Pierre |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
modify a macro to apply to a specific range of cells | Excel Discussion (Misc queries) | |||
Using Relative Reference Function to apply to Range | Excel Programming | |||
How can I apply the ROUND function to a range of cells in a workbo | Excel Discussion (Misc queries) | |||
Displaying value of specific cell within a range, with IF function...? | Excel Discussion (Misc queries) | |||
How to apply a function across a range of cells | Excel Programming |