Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Auto fill text boxes in user form by inputting data in another

I have a user-form set up which has 5 text boxes which need to have tex
put in them. I also have a page with all the info required for the abov
boxes so I am trying to find some way that I can input data into one o
the boxes and the other boxes will then be automatically filled in wit
the info from the page mentioned. The info is a database list with
separate row for each entry and there are 10 columns with 10 differen
parts of the data.
Have I explained this properly and, if so, can anyone help ?
Thanks in advance,

JOH

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto fill text boxes in user form by inputting data in another

Assume Textbox1 is where you enter the data

Data is on Sheet1, Range A1:J50

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim rng as Range, rng1 as Range, res as Variant
set rng = Worksheets("Sheet1").Range("A1:J50").columns(1)
res = Application.Match(Textbox1.Text, rng,0)
if not iserror(res) then
set rng1 = rng(res)
Textbox2.Text = rng1.offset(0,1)
Textbox3.Text = rng1.offset(0,3)
Textbox4.Text = rng1.offset(0,7)
Textbox5.Text = rng1.Offset(0,10)
Else
msgbox "Not found in database
End if
End Sub

This assumes the value in Textbox1 is alphanumeric. If it is numeric and
the entries in the cells in the lookup column are numeric then you would
need
res = Application.Match(cdbl(Textbox1.Text), rng,0)

--
Regards,
Tom Ogilvy



--
Regards,
Tom Ogilvy
"Finny33 " wrote in message
...
I have a user-form set up which has 5 text boxes which need to have text
put in them. I also have a page with all the info required for the above
boxes so I am trying to find some way that I can input data into one of
the boxes and the other boxes will then be automatically filled in with
the info from the page mentioned. The info is a database list with a
separate row for each entry and there are 10 columns with 10 different
parts of the data.
Have I explained this properly and, if so, can anyone help ?
Thanks in advance,

JOHN


---
Message posted from http://www.ExcelForum.com/



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
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
How do i fill the adjacent cell formulas in user form when i press Vicky Excel Discussion (Misc queries) 0 June 5th 06 07:38 AM
Allow user to fill in on-line form without changing formatting agnita Excel Worksheet Functions 0 October 24th 05 05:01 PM
Auto loading of a user form sometimes -\) Excel Programming 1 August 2nd 03 12:32 AM


All times are GMT +1. The time now is 11:26 AM.

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

About Us

"It's about Microsoft Excel"