ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   question to Ron (https://www.excelbanter.com/excel-programming/339004-question-ron.html)

ALEX

question to Ron
 
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

ALEX

question to Ron
 
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


Tom Ogilvy

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




ALEX

question to Ron
 
Thank you, Tom.

"Tom Ogilvy" wrote:

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






All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com