Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default vlookup problem???

My code is like this
Sub find()
Dim i as long
varr = Evaluate("Vlookup(A18, A344:AR558, {7,10,13,16,19}, False")
If IsArray(varr) then
For i = Lbound(varr) to Ubound(Varr)
Range("C18:G18").Value = Varr(i)
Next
End if
End Sub

Error which I get is you can't changea part of array.

I want the values found from array to be put in cells C18, D18, E18, F18, G18

Any help is highly appreciated

Thanks a lot in advance
--
Kittie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default vlookup problem???

One way:

Public Sub Find1()
Range("C18:G18").Value = Evaluate( _
"=VLOOKUP(A18,A344:AR558,{7,10,13,16,19}, FALSE)")
End Sub


In article ,
"Lolly" wrote:

My code is like this
Sub find()
Dim i as long
varr = Evaluate("Vlookup(A18, A344:AR558, {7,10,13,16,19}, False")
If IsArray(varr) then
For i = Lbound(varr) to Ubound(Varr)
Range("C18:G18").Value = Varr(i)
Next
End if
End Sub

Error which I get is you can't changea part of array.

I want the values found from array to be put in cells C18, D18, E18, F18, G18

Any help is highly appreciated

Thanks a lot in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default vlookup problem???

Kittie,

How about

Dim i As Long
For i = 3 To 5
cels(18, i).Value = Application.VLookup(Range("A18"), Range("A344:AR558"),
(i - 2) * 3 + 4, False)
Next

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Lolly" wrote in message
...
My code is like this
Sub find()
Dim i as long
varr = Evaluate("Vlookup(A18, A344:AR558, {7,10,13,16,19}, False")
If IsArray(varr) then
For i = Lbound(varr) to Ubound(Varr)
Range("C18:G18").Value = Varr(i)
Next
End if
End Sub

Error which I get is you can't changea part of array.

I want the values found from array to be put in cells C18, D18, E18, F18,

G18

Any help is highly appreciated

Thanks a lot in advance
--
Kittie



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default vlookup problem???

Just to add,

Here is just one more

Sounds like at least one of the cells in C18:G18 are part of a multicell
array formula. If so, you need to remove the array formula before you can
update them unless the array formula encompasses C18:G18 alone. Then your
original code could be:


Sub find()
Dim Varr As Variant
Varr = Evaluate("Vlookup(A18, A344:AR558, {7,10,13,16,19}, False)")
If IsArray(Varr) Then
Range("C18:G18").Value = Varr
End If
End Sub

Of course JE's is much more compact.
--
Tom Ogilvy



"Lolly" wrote in message
...
My code is like this
Sub find()
Dim i as long
varr = Evaluate("Vlookup(A18, A344:AR558, {7,10,13,16,19}, False")
If IsArray(varr) then
For i = Lbound(varr) to Ubound(Varr)
Range("C18:G18").Value = Varr(i)
Next
End if
End Sub

Error which I get is you can't changea part of array.

I want the values found from array to be put in cells C18, D18, E18, F18,

G18

Any help is highly appreciated

Thanks a lot in advance
--
Kittie



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 problem [email protected] Excel Worksheet Functions 0 October 5th 05 12:52 PM
VLookup problem K Excel Worksheet Functions 6 June 8th 05 10:35 PM
Vlookup Problem Trying to excel in life but need help Excel Worksheet Functions 6 April 9th 05 08:45 PM
vlookup problem Orion[_2_] Excel Programming 6 December 20th 04 03:53 PM
problem with vlookup Lolly[_2_] Excel Programming 2 October 1st 04 12:28 AM


All times are GMT +1. The time now is 04:00 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"