question to Ron
The sad think is that it makes no difference what you setting is in the
spread sheet. you can use either in VBA
ActiveCell.Formula = "=OR(A2 . .
or
ActveCell.FormulaR1C1 = "=OR(R[-10]C . . .
VBA/Excel interprets it and puts the correct information in the cell.
from the immediate window as a demo:
ActiveCell.FormulaR1C1 = "=R[-10]C"
? activecell.Formula
=A2
? activeCell.FormulaR1C1
=R[-10]C
? activeCell.Address
$A$12
--
Regards,
Tom Ogilvy
"Alex" wrote in message
...
Thanks, I've managed with it.
With Target(1, 12)
If Target.Value < "" Then
varTV = Target.Value
If varTV = "ERP" Or varTV = "PM" Or varTV = "HPW" Or varTV = "OJT"
_
Or varTV = "SBR" Or varTV = "LD" Or varTV = "CFT" Then
.FormulaR1C1 = "=True"
Else
.FormulaR1C1 = "=False"
End If
Else
.ClearContents
End If
End With
"Alex" wrote:
Ron,
How could I assign your wonderful formula you advised before
[=OR(A2={"ERP","PM","HPW","OJT","SBR"","LD","CFT"})] to the FormulaR1C1?
I'm trying different ways but nothing is working.
'A = Array("ERP", "PM", "HPW", "OJT", "SBR", "LD", "CFT")
strERP = "ERP"
strPM = "PM"
strHPW = "HPW"
strOJT = "OJT"
strSBR = "SBR"
strLD = "LD"
strCFT = "CFT"
.FormulaR1C1 =
"=OR(RC[-11]={strERP,strPM,strHPW,strOJT,strSBR,strLD,strCFT}) " '
"=OR(RC[-11]=A)"
Thanks
|