Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with Lookup-function

Sub test()
Cells(3, 3).FormulaR1C1 = "=sum(R1C1:R5C1)" 'Succees
Cells(4, 3).Value = "LOOKUP(3;R1C2:R5C2;R1C1:R5C1)" 'Succees
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3;R1C2:R5C2;R1C1:R5C1)" 'Error
End Sub

VBA in Excel 2002. Two first lines succees, but the third one gives error
'Runtime error 1004: Application or object defined error'. What's wrong with
the third row?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with Lookup-function

The second only works because you have an error, no leadiung = <vbg

Sub test()
Cells(3, 3).FormulaR1C1 = "=sum(R1C1:R5C1)" 'Succees
Cells(4, 3).Value = "=LOOKUP(3,R1C2:R5C2,R1C1:R5C1)" 'Succees
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3,R1C2:R5C2,R1C1:R5C1)" 'Error
End Sub



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SamMy" wrote in message
...
Sub test()
Cells(3, 3).FormulaR1C1 = "=sum(R1C1:R5C1)" 'Succees
Cells(4, 3).Value = "LOOKUP(3;R1C2:R5C2;R1C1:R5C1)" 'Succees
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3;R1C2:R5C2;R1C1:R5C1)" 'Error
End Sub

VBA in Excel 2002. Two first lines succees, but the third one gives error
'Runtime error 1004: Application or object defined error'. What's wrong

with
the third row?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with Lookup-function

Could you be more specific? No leading - what?

"Bob Phillips" kirjoitti:

The second only works because you have an error, no leadiung = <vbg

Sub test()
Cells(3, 3).FormulaR1C1 = "=sum(R1C1:R5C1)" 'Succees
Cells(4, 3).Value = "=LOOKUP(3,R1C2:R5C2,R1C1:R5C1)" 'Succees
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3,R1C2:R5C2,R1C1:R5C1)" 'Error
End Sub



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SamMy" wrote in message
...
Sub test()
Cells(3, 3).FormulaR1C1 = "=sum(R1C1:R5C1)" 'Succees
Cells(4, 3).Value = "LOOKUP(3;R1C2:R5C2;R1C1:R5C1)" 'Succees
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3;R1C2:R5C2;R1C1:R5C1)" 'Error
End Sub

VBA in Excel 2002. Two first lines succees, but the third one gives error
'Runtime error 1004: Application or object defined error'. What's wrong

with
the third row?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with Lookup-function

I did, no leading =.

I also gave you corrected code. As I understand, in VBA you use commas
regardless of your settings, Excel will transform it.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SamMy" wrote in message
...
Could you be more specific? No leading - what?

"Bob Phillips" kirjoitti:

The second only works because you have an error, no leadiung = <vbg

Sub test()
Cells(3, 3).FormulaR1C1 = "=sum(R1C1:R5C1)" 'Succees
Cells(4, 3).Value = "=LOOKUP(3,R1C2:R5C2,R1C1:R5C1)"

'Succees
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3,R1C2:R5C2,R1C1:R5C1)" 'Error
End Sub



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SamMy" wrote in message
...
Sub test()
Cells(3, 3).FormulaR1C1 = "=sum(R1C1:R5C1)"

'Succees
Cells(4, 3).Value = "LOOKUP(3;R1C2:R5C2;R1C1:R5C1)"

'Succees
Cells(2, 3).FormulaR1C1 = "=LOOKUP(3;R1C2:R5C2;R1C1:R5C1)" 'Error
End Sub

VBA in Excel 2002. Two first lines succees, but the third one gives

error
'Runtime error 1004: Application or object defined error'. What's

wrong
with
the third row?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with Lookup-function

Now I got it (thank god it's friday :)).

Thank You!


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problem with Lookup-function

No argument the <G

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"SamMy" wrote in message
...
Now I got it (thank god it's friday :)).

Thank You!



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
problem with LOOKUP function Boston_north Excel Discussion (Misc queries) 2 March 23rd 09 02:28 PM
LOOKUP function Problem justme Excel Worksheet Functions 2 December 13th 06 04:40 AM
LOOKUP function problem? DORI Excel Worksheet Functions 0 November 27th 05 11:45 PM
Lookup function problem (kg) greencecil Excel Worksheet Functions 3 July 1st 05 04:54 PM
problem lookup function bill gras Excel Worksheet Functions 2 June 22nd 05 03:57 PM


All times are GMT +1. The time now is 04:13 AM.

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"