Computing.Net > Forums > Office Software > ms excel

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

ms excel

Reply to Message Icon

Name: chai mf
Date: June 12, 2003 at 22:34:19 Pacific
OS: win95
CPU/Ram: 300/128
Comment:

what is wrong with the macro below:

Private Sub ComboBox1_Change()
TextBox2.Text = Application.WorksheetFunction.VLookup(ComboBox1.Text, sheet2!b:c, 2, False)

End Sub



Sponsored Link
Ads by Google

Response Number 1
Name: A Certain TH
Date: June 14, 2003 at 14:36:02 Pacific
Reply:

Several Things.

The most obvious is the range. VBA does not recognise Excel ranges in their "spreadsheet" form. "sheet2!b:c" means "a bunch of alphanumeric characters" to the VBA compiler.
ie. Specify your range in RANGE style:
Sheets("Sheet2").Range("B:C")

So your expression should be:
Application.WorksheetFunction.VLookup(ComboBox1.Text, Sheets("Sheet2").Range("B:C"), 2, False)

Cheers
Tom


0

Response Number 2
Name: chai
Date: June 14, 2003 at 17:39:37 Pacific
Reply:

Thanks Tom


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: ms excel

MS Excel 2002 wont open a PDF link www.computing.net/answers/office/ms-excel-2002-wont-open-a-pdf-link/5209.html

MS Excel - Change text with IF www.computing.net/answers/office/ms-excel-change-text-with-if-/5644.html

Restrict value in MS Excel www.computing.net/answers/office/restrict-value-in-ms-excel/3550.html