Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications

Post new topic   Reply to topic
Worksheet function, vlookup not working, can anymore help?
View previous topic :: View next topic  
Author Message
bremen
Newbie


Joined: 16 Jun 2005
Posts: 2

PostPosted: Jun 30th, 2005 09:36 AM    Post subject: Worksheet function, vlookup not working, can anymore help? Reply with quote

I'm working on a loop with will excecte the vlookup from worksheet function.
If I hard code the criteria, the function works fine, but when I changed the criteria into a varible, then an error msg comes up say can't find the vlookup property from worksheet.function.
' works fine with "A10" as critiera
nana = Application.WorksheetFunction.VLookup("A10", _
Sheet12.Columns("B"), 1, False)

' error msg when i replaced "A10" with aRange
aRange = Sheet4.Range("A" & k)
nana = Application.WorksheetFunction.VLookup(aRange, _
Sheet12.Columns("B"), 1, False)

I'm wondering if it's to do with the return type?
I'm not sure what the problem is and really hope you guys can give me a hand here.
Thank you!!
Back to top
View user's profile Send private message
more
Newbie


Joined: 07 Jun 2005
Posts: 13

PostPosted: Jul 4th, 2005 02:56 AM    Post subject: You forgot just a little bitsy something Reply with quote

you forgot to use the ampersand "&" with your string.

you should do like this: an example

nana=blabla.blabla("A10" & _
blabla,(false))

the ampersand "&" connects the string when you use the underscore.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Visual Basic for Applications All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic