Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This formula works in the cell but I need it in VBA and it doesn't want to
play! The formula is in cell J4 =IF(I4=(VLOOKUP(K4,'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!$A$2:$C$40,3,FALSE)),"","88888888") I have tried this: ActiveCell.FormulaR1C1 = "=IF(RC[-1]="(VLOOKUP(RC[+1],'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!$A$2:$C$40,3,FALSE)","""",88888888))" Is it just a formatting thing? -- Regards, Dean |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are mixing R1C1 and A1
Try Const sVLOOKUP As String = _ "VLOOKUP(RC[+1],'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!R2C1:R40C3,3,FALSE)" ActiveCell.FormulaR1C1 = _ "=IF(RC[-1]=" & sVLOOKUP & ","""",88888888)" -- __________________________________ HTH Bob "Melbridge" wrote in message ... This formula works in the cell but I need it in VBA and it doesn't want to play! The formula is in cell J4 =IF(I4=(VLOOKUP(K4,'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!$A$2:$C$40,3,FALSE)),"","88888888") I have tried this: ActiveCell.FormulaR1C1 = "=IF(RC[-1]="(VLOOKUP(RC[+1],'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!$A$2:$C$40,3,FALSE)","""",88888888))" Is it just a formatting thing? -- Regards, Dean |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Bob,
I'll have to remember that - I'm not a programmer (as you probably guessed), I just cut n paste then modify! -- Regards, Dean "Bob Phillips" wrote: You are mixing R1C1 and A1 Try Const sVLOOKUP As String = _ "VLOOKUP(RC[+1],'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!R2C1:R40C3,3,FALSE)" ActiveCell.FormulaR1C1 = _ "=IF(RC[-1]=" & sVLOOKUP & ","""",88888888)" -- __________________________________ HTH Bob "Melbridge" wrote in message ... This formula works in the cell but I need it in VBA and it doesn't want to play! The formula is in cell J4 =IF(I4=(VLOOKUP(K4,'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!$A$2:$C$40,3,FALSE)),"","88888888") I have tried this: ActiveCell.FormulaR1C1 = "=IF(RC[-1]="(VLOOKUP(RC[+1],'E:\MANMON\TEAMS VALIDATION\Teams Master\[TEAMS_Master.xls]Officers'!$A$2:$C$40,3,FALSE)","""",88888888))" Is it just a formatting thing? -- Regards, Dean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VLookUp - Does the VLookUp return the exact information? | Excel Worksheet Functions | |||
Vlookup problem - unable to get the vlookup property | Excel Programming | |||
using a vlookup to enter text into rows beneath the vlookup cell | Excel Programming | |||
Vlookup in vlookup - taking the result as array name | Excel Worksheet Functions | |||
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP | Excel Discussion (Misc queries) |