Hi Charlie,

Can you post your workbook?  The original workbook you posted did not seem
to contain your VBA project--just the data.

 

If I can see your form code I can better tell what might be going on.

 

Asa

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Cab Boose
Sent: Sunday, February 05, 2012 1:35 PM
To: excel-macros@googlegroups.com
Subject: Re: $$Excel-Macros$$ vlookup in Text Box

 

Hi Asa

 

Have changed the two things, but now I get a 1004 error.   Unable to get the
vlookup of the worksheet function class.  

 

 

Note that I have Option Explicit at top of page, do I need to declare
anything ?

Thanks

 

 

Charlie

On Sun, Feb 5, 2012 at 8:20 PM, Asa Rossoff <a...@lovetour.info> wrote:

Hi Charlie,

Glad my last post helped :)

 

>From a quick look I see two issues/potential issues:

1.       The syntax error:

TextBox5.Value = WorksheetFunction.VLookup(TextBox8.Value,
Range.("DBase"),2,False)

Remove the "." between "Range" and ("Dbase"):

TextBox5.Value = WorksheetFunction.VLookup(TextBox8.Value, Range
("DBase"),2,False)

2.       The Defined Names (ranges) in your workbook.  They include the
header row, which can interfere with lookup functions.  Not a high
likelihood in the exact usage that you have here, but still might be a good
idea to change.

 

P.S. In my last post, I used ActiveWorkbook.Worksheets(.).Range(.) in the
Userform_Initialize event to set up the linked cell.  You can consider if
ThisWorkbook is more appropriate than ActiveWorkbook in a given instance.  I
actually recommend always using ThisWorkbook if the workbook containing the
VBA code/userform is the workbook you mean and only using ActiveWorkbook
when you might mean another workbook---that which is on-screen at any given
moment.  Avoid pitfalls that way.  Whoops :)

Asa

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Cab Boose
Sent: Saturday, February 04, 2012 10:48 PM
To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ vlookup in Text Box

 

Hi

 

See attached worksheet.   Excel2000

 

I have  userform1  and one of the codes is to lookup a part # (in Textbox
8)( say Part # 30000 is to be entered here) in a named range called  DBase
Once located to place the description in  textbox 5(named Description)

 

This is the code as per attached workbook,  have played around with the code
but still not working.  Currently get a message for Syntax error.

 

 

 

 

Private Sub TextBox8_Change()
    TextBox5.Value = WorksheetFunction.VLookup(TextBox8.Value,
Range.("DBase"),2,False)
End Sub

 

So if 3000 entered in Part # text box8  I would expect to get in Textbox 5
the description:    Print.Download-1/64...................

 

Will have a 1000 + rows eventually. Will make the named range dynamic as
well.

 

Not much code to check.  Your advice much appreciated.

Thanks

 

Charlie

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

 

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to