Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Vlookup In Vba/excel


1 reply to this topic

#1 Dagoth Nereviar

    Privileged Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 536 posts
  • Gender:Male
  • Location:Leeds, UK
  • Interests:Spellbinder!

Posted 05 March 2007 - 11:18 AM

What I'm trying to do is have it that when you click a command button ("CommandButton1" name will be changed later on :P), it looks up a value on the work sheet "TimeTable" and changes the caption ("Label1" again will change it :() on the form "UserForm1".

What I have is some simple code:
Private Sub CommandButton1_Click()

Label1.Caption = Application.WorksheetFunction.VLookup("Gateway Plaza", "C3:C26", 1, False)

End Sub

At first I kept getting "Run time error 13" but I added "WorksheetFunction" and then I started getting "Run time error 1004: Unable to get the Vlookup property of the WorksheetFunction Class"

How do I fix it?

Edit: Haha, I didn't need to use Vlookup :( All I had to do was:
Label1.Caption = Range("C3") :(

Close topic please :(

Edited by Dagoth Nereviar, 05 March 2007 - 11:26 AM.


#2 iGuest

    Hail Caesar!

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5,876 posts
  • Interests:Trap17 Free Web Hosting, No Ads

Posted 31 May 2009 - 04:51 AM

Vlookup macroVlookup In Vba/excel

Dear all, if anybody could help me creating a vlookup macro using offset. Data is too large so I need a macro which work fast. Sheet1 contains folio in coloum A and units in coulumn B. Sheet2 contains the same. I want compare the units for same folio in coulumn C.

Thanks in advance

-question by Sandeep

 






Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users