Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
QB QB is offline
external usenet poster
 
Posts: 57
Default vlookup woes

I coded the following, which worked beautifully in Excel 2003

Range("L2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC10,Configuration!R1C1:R" &
lstRowConfig & "C2,2,FALSE)"

Now however, in 2007 in get in the cell
=VLOOKUP(RC10,Configuration!R1C1:R10C2,2,FALSE)

but it does not actually return a value, it jsut displays the formula????
In 2003 it returned the value and everything worked like a charm?

Any ideas why it no longer works and how to fix it.

Thank you,

QB
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default vlookup woes

Hi,

Nothing has changed in E2007 that would cause this, I suspect the cell into
which your putting the formula may be formatted as text. Try this

With Range("L2")
.NumberFormat = "General"
.FormulaR1C1 = "=VLOOKUP(RC10,Configuration!R1C1:R" & _
lstRowConfig & "C2,2,FALSE)"
End With

Mike

"QB" wrote:

I coded the following, which worked beautifully in Excel 2003

Range("L2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC10,Configuration!R1C1:R" &
lstRowConfig & "C2,2,FALSE)"

Now however, in 2007 in get in the cell
=VLOOKUP(RC10,Configuration!R1C1:R10C2,2,FALSE)

but it does not actually return a value, it jsut displays the formula????
In 2003 it returned the value and everything worked like a charm?

Any ideas why it no longer works and how to fix it.

Thank you,

QB

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default vlookup woes

The below works both in 2003 and 2007

-Make sure you have the sheet named Configuration
-Also check whether the cell is formatted as 'General' and not as 'Text'

lstRowConfig = 2
Range("L2").FormulaR1C1 = "=VLOOKUP(RC10,Configuration!R1C1:R" & _
lstRowConfig & "C2,2,FALSE)"

If this post helps click Yes
---------------
Jacob Skaria


"QB" wrote:

I coded the following, which worked beautifully in Excel 2003

Range("L2").Select
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC10,Configuration!R1C1:R" &
lstRowConfig & "C2,2,FALSE)"

Now however, in 2007 in get in the cell
=VLOOKUP(RC10,Configuration!R1C1:R10C2,2,FALSE)

but it does not actually return a value, it jsut displays the formula????
In 2003 it returned the value and everything worked like a charm?

Any ideas why it no longer works and how to fix it.

Thank you,

QB

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 Woes Greg Snidow Excel Programming 2 July 19th 07 03:10 AM
Hexadecimal Woes Bryan Loeper Excel Programming 4 May 20th 07 01:42 AM
More RGB Woes Zone Excel Programming 3 August 19th 06 06:40 PM
Userform Woes gachett Excel Programming 2 December 29th 05 03:20 PM
For Each Next woes AZ Analog Excel Programming 4 May 23rd 05 08:53 PM


All times are GMT +1. The time now is 11:24 PM.

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

About Us

"It's about Microsoft Excel"