Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PA PA is offline
external usenet poster
 
Posts: 101
Default Input data form with drop down list

Dear All,

I have data at sheet1 as follows

Material Date Qty UnitCost Total
AAA 1/01/2006 2 3 9
BBB 3/01/2006 3 4 16

I try to create the data input form with the following VB Code

Sub Inputform()

ActiveSheet.ShowDataForm

End Sub

The result if I run this macro == as Data Input FORM

-----------------------------------------------------------------------
Sheet 1
-----------------------------------------------------------------------

Material _______ New Record
Date: _______ New
Qty : _______ Delete
Cost : ________ Restore
Total : ________ Find Prev
Find Next
Criteria
Close

all ______ fields are to be input manually.If I wish to have Field Materail
at this data input form as a "Dropdown field" instead of we need input it
manually, but still as part of this data input form, is there any way by
using any VB code to create it?

Many thanks for any advise and help,

Best Regards

PA












  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Input data form with drop down list

Hi Pa

See
http://www.j-walk.com/ss/dataform/index.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"PA" wrote in message ...
Dear All,

I have data at sheet1 as follows

Material Date Qty UnitCost Total
AAA 1/01/2006 2 3 9
BBB 3/01/2006 3 4 16

I try to create the data input form with the following VB Code

Sub Inputform()

ActiveSheet.ShowDataForm

End Sub

The result if I run this macro == as Data Input FORM

-----------------------------------------------------------------------
Sheet 1
-----------------------------------------------------------------------

Material _______ New Record
Date: _______ New
Qty : _______ Delete
Cost : ________ Restore
Total : ________ Find Prev
Find Next
Criteria
Close

all ______ fields are to be input manually.If I wish to have Field Materail
at this data input form as a "Dropdown field" instead of we need input it
manually, but still as part of this data input form, is there any way by
using any VB code to create it?

Many thanks for any advise and help,

Best Regards

PA














  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Input data form with drop down list

Or try something like this. Sets the combo box's RowSource and
ControlSource properties to refer to named ranges in the workbook
"Book1". Interestingly, it appears you can't have RowSource and
ControlSource refer to ranges in an addin, only a regular workbook.

Private Sub UserForm_Initialize()

Dim Wb As Workbook
Dim CBRS, CBCS As String

Set Wb = Workbooks("Book1")
CBRS = Wb.Names("CBColors").RefersTo
CBRS = Right(CBRS, Len(CBRS) - 1)
CBCS = Wb.Names("CBColorValue").RefersTo
CBCS = Right(CBCS, Len(CBCS) - 1)
With Me.ComboBox1
.RowSource = CBRS
.ControlSource = CBCS
End With

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
PA PA is offline
external usenet poster
 
Posts: 101
Default Input data form with drop down list

Dear Ron and Martin

Many thanks.It solve my problem.

Best Regards

PA

"PA" wrote:

Dear All,

I have data at sheet1 as follows

Material Date Qty UnitCost Total
AAA 1/01/2006 2 3 9
BBB 3/01/2006 3 4 16

I try to create the data input form with the following VB Code

Sub Inputform()

ActiveSheet.ShowDataForm

End Sub

The result if I run this macro == as Data Input FORM

-----------------------------------------------------------------------
Sheet 1
-----------------------------------------------------------------------

Material _______ New Record
Date: _______ New
Qty : _______ Delete
Cost : ________ Restore
Total : ________ Find Prev
Find Next
Criteria
Close

all ______ fields are to be input manually.If I wish to have Field Materail
at this data input form as a "Dropdown field" instead of we need input it
manually, but still as part of this data input form, is there any way by
using any VB code to create it?

Many thanks for any advise and help,

Best Regards

PA












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
Drop-down list on simple excel 2003 form using "form" from data me S Beals Excel Discussion (Misc queries) 0 March 2nd 10 08:35 PM
how do I creat an input form in excel 2007 to include drop down bo DaveH Excel Discussion (Misc queries) 2 May 18th 08 06:40 AM
User Form - Get Data From Drop List Tony Excel Discussion (Misc queries) 0 January 7th 08 08:54 PM
How do I add input data in the input ranges in drop down boxes. oil_driller Excel Discussion (Misc queries) 1 November 9th 05 10:31 PM
Data Input - User Form Drop-Down Box meflorence[_3_] Excel Programming 2 May 18th 04 02:43 PM


All times are GMT +1. The time now is 06:36 PM.

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"