Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Never posted before...
If you please.... I have the following working formula in cell H69 (for example): =IF(D69=0,"","Limit") When D69 equals zero, H69 is blank, otherwise it shows the string "Limit". A macro will assign this formula to a particular cell and it won't always be row 69. How can I replace the D69 with something akin to "current column minus 4" & "current row"? The VBA is ActiveCell = <the formula above Thanks for any ideas! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub test2()
Dim sFmla As String sFmla = "=IF(RC[-4]=0,"""",""Limit"")" ActiveCell = sFmla ' or ActiveCell.Formula = sFmla ' or ActiveCell.FormulaR1C1 = sFmla 'no need to use activecell, eg Range("E1:E5").Formula = sFmla End Sub Regards, Peter T "NorMacro" wrote in message oups.com... Never posted before... If you please.... I have the following working formula in cell H69 (for example): =IF(D69=0,"","Limit") When D69 equals zero, H69 is blank, otherwise it shows the string "Limit". A macro will assign this formula to a particular cell and it won't always be row 69. How can I replace the D69 with something akin to "current column minus 4" & "current row"? The VBA is ActiveCell = <the formula above Thanks for any ideas! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
ActiveCell.FormulaR1C1 = "=IF(R[]C[-4]=0,"""",""Limit"")" In article .com, NorMacro wrote: Never posted before... If you please.... I have the following working formula in cell H69 (for example): =IF(D69=0,"","Limit") When D69 equals zero, H69 is blank, otherwise it shows the string "Limit". A macro will assign this formula to a particular cell and it won't always be row 69. How can I replace the D69 with something akin to "current column minus 4" & "current row"? The VBA is ActiveCell = <the formula above Thanks for any ideas! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you. Your adjustment to my formula along with your method(s)
worked smoothly. I want to point out though that, as you went about it, the macro evaluates the IF statement and assigns either blank or "Limit" to the cell. I would sure like to have a formula in the target cell, such that it can continue to evaluate the conditions in the cell four columns left and continue to display either blank or "Limit". If you have the patience with me...thanks in advance! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Did you look in the formula bar for the cells you ran the macro on?
It looks to me like the macro put the formula in the cell and it will continue to evaluate and execute the result. "NorMacro" wrote: Thank you. Your adjustment to my formula along with your method(s) worked smoothly. I want to point out though that, as you went about it, the macro evaluates the IF statement and assigns either blank or "Limit" to the cell. I would sure like to have a formula in the target cell, such that it can continue to evaluate the conditions in the cell four columns left and continue to display either blank or "Limit". If you have the patience with me...thanks in advance! |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Peter, JE, JL,
I just found that I had not in fact removed an old line of macro code that I believed I had removed. It now works perfectly! Thanks for your time! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How a cell can be addressed with variable file-column? | Excel Discussion (Misc queries) | |||
Please help - formula works in some cells but evaluates to #value in others | Excel Worksheet Functions | |||
questions being addressed | Excel Worksheet Functions | |||
Simplifying array formula which evaluates as error. | Excel Worksheet Functions | |||
Can I create a formula in Excel that evaluates form information? | Excel Worksheet Functions |