Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Populate Userform text boxes in VBA with VLookup data from #2 worksheet

I'm having a difficult time with the syntax to be able to populate textbox
controls in a userform using VLookup with data in a worksheet outside of the
userform .

Can anyone help? Is it even possible to code this in VBA?

I'm using something like this in a standard module:

Dim UF as Userform
Set UF = UserFormLoanReqInpute

with UF
.tbBorr1Name = application.worksheetfunction.vlookup(.tbBorr1CIF, ("C:\My
Documents\cf_details.xls!Range("Database"),3,false )

I get error #1004

Please help as I need to complete this project ASAP!

Thanks . . . . . Laz



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Populate Userform text boxes in VBA with VLookup data from #2 worksheet

You would need to open cf_details.xls

--
Regards,
Tom Ogilvy

"Laz" wrote in message
...
I'm having a difficult time with the syntax to be able to populate textbox
controls in a userform using VLookup with data in a worksheet outside of

the
userform .

Can anyone help? Is it even possible to code this in VBA?

I'm using something like this in a standard module:

Dim UF as Userform
Set UF = UserFormLoanReqInpute

with UF
.tbBorr1Name =

application.worksheetfunction.vlookup(.tbBorr1CIF, ("C:\My
Documents\cf_details.xls!Range("Database"),3,false )

I get error #1004

Please help as I need to complete this project ASAP!

Thanks . . . . . Laz





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Populate Userform text boxes in VBA with VLookup data from #2 worksheet

I still get the same error message. Any other ideas would be appreciated.

Laz

"Tom Ogilvy" wrote in message
...
You would need to open cf_details.xls

--
Regards,
Tom Ogilvy

"Laz" wrote in message
...
I'm having a difficult time with the syntax to be able to populate

textbox
controls in a userform using VLookup with data in a worksheet outside of

the
userform .

Can anyone help? Is it even possible to code this in VBA?

I'm using something like this in a standard module:

Dim UF as Userform
Set UF = UserFormLoanReqInpute

with UF
.tbBorr1Name =

application.worksheetfunction.vlookup(.tbBorr1CIF, ("C:\My
Documents\cf_details.xls!Range("Database"),3,false )

I get error #1004

Please help as I need to complete this project ASAP!

Thanks . . . . . Laz







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate Userform text boxes in VBA with VLookup data from #2 worksheet

Here's what I would do:

.tbBorr1Name.Value =
Range("Database").Find(What:=.tbBorr1CIF.Value).Of fset(0, 3).Value

You might want to rename database to be the first column of your
database to avoid finding records in other columns.

Let me know if that doesn't work.

Mark

Laz wrote:
*I still get the same error message. Any other ideas would be
appreciated.

Laz

"Tom Ogilvy" wrote in message
...
You would need to open cf_details.xls

--
Regards,
Tom Ogilvy

"Laz" wrote in message
...
I'm having a difficult time with the syntax to be able to

populate

textbox
controls in a userform using VLookup with data in a worksheet

outside of
the
userform .

Can anyone help? Is it even possible to code this in VBA?

I'm using something like this in a standard module:

Dim UF as Userform
Set UF = UserFormLoanReqInpute

with UF
.tbBorr1Name =

application.worksheetfunction.vlookup(.tbBorr1CIF, ("C:\My
Documents\cf_details.xls!Range("Database"),3,false )

I get error #1004

Please help as I need to complete this project ASAP!

Thanks . . . . . Laz




*




------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Populate Userform text boxes in VBA with VLookup data from #2 worksheet

OK this worked; but only if cf_detail.xls is the active workbook. How can i
code the vlookup part of the code (arg #2: range to look in) so that
cf_detail.xls does not need to be the acitve workbook?

I change it to ..........Range("Database") and it only works if
cf_details.xls is the active workbook. This workbook will not be the active
one. It looks as if I need to quality the Range("Database") whose syntax I
do not know.



Thanks in advance for the help!
Laz

"Tom Ogilvy" wrote in message
...
You would need to open cf_details.xls

--
Regards,
Tom Ogilvy

"Laz" wrote in message
...
I'm having a difficult time with the syntax to be able to populate

textbox
controls in a userform using VLookup with data in a worksheet outside of

the
userform .

Can anyone help? Is it even possible to code this in VBA?

I'm using something like this in a standard module:

Dim UF as Userform
Set UF = UserFormLoanReqInpute

with UF
.tbBorr1Name =

application.worksheetfunction.vlookup(.tbBorr1CIF, ("C:\My
Documents\cf_details.xls!Range("Database"),3,false )

I get error #1004

Please help as I need to complete this project ASAP!

Thanks . . . . . Laz







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? populate 3 columns of data when match a common value, UMPhy Tom Excel Worksheet Functions 1 March 13th 08 07:26 PM
populate cell on worksheet 2 if text is red on worksheet 1 SCrowley Excel Worksheet Functions 14 May 15th 07 09:28 PM
how can i re-populate a userform with data already entered? Paul Dye New Users to Excel 1 January 24th 07 04:49 AM
Best way to populate worksheet from 2 combo boxes jswasson Excel Worksheet Functions 0 July 7th 06 01:21 PM
userform text boxes Jo[_4_] Excel Programming 4 September 23rd 03 03:38 AM


All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"