ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Combobox with Commandbutton in Userform! (https://www.excelbanter.com/excel-programming/299635-combobox-commandbutton-userform.html)

Stift[_16_]

Combobox with Commandbutton in Userform!
 
Hi, Can someone please help me with creating an inputform in VBA with
excel database?

I want to have a userform that have a Combobox and a Commandbutton.

The combobox must contain all cells of Sheet1 Column C9-C63.
And only shows C9. When the user press the Command Button. It mus
show the next cell and so on till all cells are displayed.

This will help me creating a begin of my project for school so pleas
help me !!!


A lot of Thanks in advance !!!


Robber

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


BrianB

Combobox with Commandbutton in Userform!
 
Set the combobox rowSource property to C9:C63.

Use this code in the form :-

'-----------------------------------------------------
Private Sub UserForm_Initialize()
Me.ComboBox1.ListIndex = 0
End Sub
'---------------------------------------

Private Sub CommandButton1_Click()
x = Me.ComboBox1.ListIndex
Me.ComboBox1.ListIndex = IIf(x = 54, 0, x + 1)
End Sub
'--------------------------------------

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


Tom Ogilvy

Combobox with Commandbutton in Userform!
 
These should get you started:

http://support.microsoft.com/default.aspx?kbid=161514
XL97: How to Use a UserForm for Entering Data

http://support.microsoft.com/default.aspx?kbid=213749
XL2000: How to Use a UserForm for Entering Data

http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
Lesson 11: Creating a Custom Form
Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.
http://j-walk.com/ss/excel/tips/tip84.htm

http://support.microsoft.com/default...b;en-us;829070
How to use Visual Basic for Applications examples to control UserForms in
Microsoft Excel

http://support.microsoft.com/support.../q213/7/32.asp
XL2000: Using the LoadPicture Function with an Image Control



Here are some other sources of information:


http://support.microsoft.com/?id=168067
File Title: Microsoft(R) Visual Basic(R) for Applications Examples for
Controlling UserForms in Microsoft Excel 97
File Name: WE1163.EXE
File Size: 161742 bytes
File Date: 05/08/97
Keywords: kbfile
Description: This Application Note is an introduction to manipulating
UserForms in Microsoft Excel 97. It includes examples and Microsoft Visual
Basic for Applications macros that show you how to take advantage of the
capabilities of UserForms and use each of the ActiveX controls that are
available for UserForms

Peter Aiken Articles:
Part I
http://msdn.microsoft.com/library/en...FormsPartI.asp
Part II
http://msdn.microsoft.com/library/en...ormsPartII.asp


http://support.microsoft.com/default...;EN-US;Q168067


Regards,
Tom Ogilvy

"Stift " wrote in message
...
Hi, Can someone please help me with creating an inputform in VBA with a
excel database?

I want to have a userform that have a Combobox and a Commandbutton.

The combobox must contain all cells of Sheet1 Column C9-C63.
And only shows C9. When the user press the Command Button. It must
show the next cell and so on till all cells are displayed.

This will help me creating a begin of my project for school so please
help me !!!


A lot of Thanks in advance !!!


Robbert


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




Stift[_17_]

Combobox with Commandbutton in Userform!
 
Thanks, I'm going to take a look and it and let you know if I can get i
to work

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


Stift[_18_]

Combobox with Commandbutton in Userform!
 
I get error : Runtime error 380

Could not set the List Index Property. Invalid property value

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


Tom Ogilvy

Combobox with Commandbutton in Userform!
 
My guess would be that you are setting it to a value that does not exist.

The index property starts a zero and goes to the Listcount -1

You can also set it to -1 if you don't want anything selected.

Generally, if you want any meaningful help, you need to post the relevant
sections of your code.

--
Regards,
Tom Ogilvy

"Stift " wrote in message
...
I get error : Runtime error 380

Could not set the List Index Property. Invalid property value.


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




Stift[_19_]

Combobox with Commandbutton in Userform!
 
Superb No It works :D :D

I've edit the topic for the next problem

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


Stift[_22_]

Combobox with Commandbutton in Userform!
 
Pleas HELP me !!!! :mad: :rolleyes

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



All times are GMT +1. The time now is 12:41 PM.

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