ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use a UserForm to preview data (https://www.excelbanter.com/excel-programming/278236-use-userform-preview-data.html)

Soniya

Use a UserForm to preview data
 
Hi all,

Is it possible to use a UserForm to preview data?

I have the folowing in a sheet

Account Branch RecNo Amount

abcd a 1 10
def b 2 15
abcd b 3 25
defg a 4 20

If I create a UserForm with a combobox for RecNo and
three TextBoxes for corresponding data, How can i code to
get the data on TextBox ?

TIA
Soniya



keepITcool

Use a UserForm to preview data
 
Soniya..


create a defined name for the range e.g. "formSource"


set following properties of the combobox

..rowsource "formSource" (text)
..columncount 4
..columnwidths 0 pt;0 pt;;0 pt
..matchentry 0 matchentryfirst
,matchrequired true
..style 2 fmstylelist

then add following event in the code module of the form
With ComboBox1
TextBox1 = .List(.ListIndex, 0)
TextBox2 = .List(.ListIndex, 1)
TextBox3 = .List(.ListIndex, 3)
End With

suc6

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"Soniya" wrote:

Hi all,

Is it possible to use a UserForm to preview data?

I have the folowing in a sheet

Account Branch RecNo Amount

abcd a 1 10
def b 2 15
abcd b 3 25
defg a 4 20

If I create a UserForm with a combobox for RecNo and
three TextBoxes for corresponding data, How can i code to
get the data on TextBox ?

TIA
Soniya






All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com