convert excel formula to vba

sergioMabres

Well-known Member
Joined
Feb 24, 2013
Messages
946
E27 works too the formula is relative, but, you have to be in E27 it works on the selected cell
 
Last edited:

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Judoman

New Member
Joined
Nov 7, 2014
Messages
28
E27 works too the formula is relative, but, you have to be in E27 it works on the selected cell
Having to be in a specific cell is not what I was after. What I would like is when A7 has X and E19 has X then E27 would automatically have an X. Second part is if E7 has X and E19 has X then E27 would again have autofill X.

For me, simply adding the Xs to A7 and E19 does nothing, even if I have E27 selected. If I run macro1 from Macros list I get a Compile error: Syntax error
 

sergioMabres

Well-known Member
Joined
Feb 24, 2013
Messages
946
If you want to be in E27 change the macro to
Code:
Sub Macro1()
'
' Macro4 Macro
'

'
    Range("E27").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(AND(R[-20]C[-4]=""X"",R[-8]C=""X""),""X"",IF(AND(R[-20]C=""X"",R[-21]C= ""F9EX Ey II"", R[-8]C=""X""),""X"",IF(AND(R[-20]C=""X"",R[-21]C=""F9DX EY II"", R[-8]C=""X""),""X"","""")))"
    Range("E28").Select
End Sub
This works only for E27
Cheers
Sergio
 

Judoman

New Member
Joined
Nov 7, 2014
Messages
28
OK, this one works perfectly for what I need. I really appreciate all your help Sergio. I never would have figured this out myself.
 

Watch MrExcel Video

Forum statistics

Threads
1,098,868
Messages
5,465,163
Members
406,415
Latest member
silungwewilliam

This Week's Hot Topics

Top