Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default vlookup - how to put this into VBA

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default vlookup - how to put this into VBA

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default vlookup - how to put this into VBA

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
Vlookup problem - unable to get the vlookup property Fred Excel Programming 2 August 22nd 08 05:23 PM
using a vlookup to enter text into rows beneath the vlookup cell Roger on Excel Excel Programming 1 November 29th 07 12:09 PM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM


All times are GMT +1. The time now is 03:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"