Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default combobox filling problem


hi !

i have a problem with the filling of a comobobox.
first of all a code sniplet:


Private Sub Worksheet_Activate()

ComboBox1.Clear

ComboBox1.AddItem "Fichte/Lärche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

ComboBox1.Text = ComboBox1.List(0)

End Sub

the problem:

if i open the excel file the combobox is empty or one entry is inside
but the others are missing.

i can't imagine where the problem is.
the code is very simple and clear...

do anybody have an idea ?

if there are any questions plz take a look at the attached file


+-------------------------------------------------------------------+
|Filename: Testfall_A1_Bodenwert.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4359 |
+-------------------------------------------------------------------+

--
honoluluzulu
------------------------------------------------------------------------
honoluluzulu's Profile: http://www.excelforum.com/member.php...o&userid=31569
View this thread: http://www.excelforum.com/showthread...hreadid=512642

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default combobox filling problem

Works OK for me (XL2003). And yours worked if you ativate the sheet by
sitching to sheet2 and then sheet1.

"honoluluzulu" wrote:


hi !

i have a problem with the filling of a comobobox.
first of all a code sniplet:


Private Sub Worksheet_Activate()

ComboBox1.Clear

ComboBox1.AddItem "Fichte/LĂ€rche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

ComboBox1.Text = ComboBox1.List(0)

End Sub

the problem:

if i open the excel file the combobox is empty or one entry is inside
but the others are missing.

i can't imagine where the problem is.
the code is very simple and clear...

do anybody have an idea ?

if there are any questions plz take a look at the attached file


+-------------------------------------------------------------------+
|Filename: Testfall_A1_Bodenwert.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4359 |
+-------------------------------------------------------------------+

--
honoluluzulu
------------------------------------------------------------------------
honoluluzulu's Profile: http://www.excelforum.com/member.php...o&userid=31569
View this thread: http://www.excelforum.com/showthread...hreadid=512642


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default combobox filling problem


this is true, but is there a possibility to fill the combobox by opening
the file ?!
so i have to switch to sheet 2 and return to sheet 1 - this is not a
good solution....

Toppers Wrote:
Works OK for me (XL2003). And yours worked if you ativate the sheet by
sitching to sheet2 and then sheet1.

"honoluluzulu" wrote:


hi !

i have a problem with the filling of a comobobox.
first of all a code sniplet:


Private Sub Worksheet_Activate()

ComboBox1.Clear

ComboBox1.AddItem "Fichte/LĂ€rche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

ComboBox1.Text = ComboBox1.List(0)

End Sub

the problem:

if i open the excel file the combobox is empty or one entry is

inside
but the others are missing.

i can't imagine where the problem is.
the code is very simple and clear...

do anybody have an idea ?

if there are any questions plz take a look at the attached file



+-------------------------------------------------------------------+
|Filename: Testfall_A1_Bodenwert.zip

|
|Download: http://www.excelforum.com/attachment.php?postid=4359

|

+-------------------------------------------------------------------+

--
honoluluzulu

------------------------------------------------------------------------
honoluluzulu's Profile:

http://www.excelforum.com/member.php...o&userid=31569
View this thread:

http://www.excelforum.com/showthread...hreadid=512642




--
honoluluzulu
------------------------------------------------------------------------
honoluluzulu's Profile: http://www.excelforum.com/member.php...o&userid=31569
View this thread: http://www.excelforum.com/showthread...hreadid=512642

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default combobox filling problem

put code in "Thisworkbook" so combobox is filled when workbook is opened



Sub workbook_open()
With Worksheets("sheet1")
..ComboBox1.Clear

..ComboBox1.AddItem "Fichte/LĂ€rche"
..ComboBox1.AddItem "Mischwald"
..ComboBox1.AddItem "Laubwald"
..ComboBox1.AddItem "Kiefer/Auwald"
End With
End Sub


"Toppers" wrote:

Works OK for me (XL2003). And yours worked if you ativate the sheet by
sitching to sheet2 and then sheet1.

"honoluluzulu" wrote:


hi !

i have a problem with the filling of a comobobox.
first of all a code sniplet:


Private Sub Worksheet_Activate()

ComboBox1.Clear

ComboBox1.AddItem "Fichte/LĂ€rche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

ComboBox1.Text = ComboBox1.List(0)

End Sub

the problem:

if i open the excel file the combobox is empty or one entry is inside
but the others are missing.

i can't imagine where the problem is.
the code is very simple and clear...

do anybody have an idea ?

if there are any questions plz take a look at the attached file


+-------------------------------------------------------------------+
|Filename: Testfall_A1_Bodenwert.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4359 |
+-------------------------------------------------------------------+

--
honoluluzulu
------------------------------------------------------------------------
honoluluzulu's Profile: http://www.excelforum.com/member.php...o&userid=31569
View this thread: http://www.excelforum.com/showthread...hreadid=512642


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default combobox filling problem

See my second reply.

"honoluluzulu" wrote:


this is true, but is there a possibility to fill the combobox by opening
the file ?!
so i have to switch to sheet 2 and return to sheet 1 - this is not a
good solution....

Toppers Wrote:
Works OK for me (XL2003). And yours worked if you ativate the sheet by
sitching to sheet2 and then sheet1.

"honoluluzulu" wrote:


hi !

i have a problem with the filling of a comobobox.
first of all a code sniplet:


Private Sub Worksheet_Activate()

ComboBox1.Clear

ComboBox1.AddItem "Fichte/LÀrche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

ComboBox1.Text = ComboBox1.List(0)

End Sub

the problem:

if i open the excel file the combobox is empty or one entry is

inside
but the others are missing.

i can't imagine where the problem is.
the code is very simple and clear...

do anybody have an idea ?

if there are any questions plz take a look at the attached file



+-------------------------------------------------------------------+
|Filename: Testfall_A1_Bodenwert.zip

|
|Download: http://www.excelforum.com/attachment.php?postid=4359

|

+-------------------------------------------------------------------+

--
honoluluzulu

------------------------------------------------------------------------
honoluluzulu's Profile:

http://www.excelforum.com/member.php...o&userid=31569
View this thread:

http://www.excelforum.com/showthread...hreadid=512642




--
honoluluzulu
------------------------------------------------------------------------
honoluluzulu's Profile: http://www.excelforum.com/member.php...o&userid=31569
View this thread: http://www.excelforum.com/showthread...hreadid=512642




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default combobox filling problem


i already had this idea but if you try Combobox1 is unknown at this
point
i get an error "subscript out of range" by compiling this code at
workbook open action

Private Sub Workbook_Open()


With Worksheets("Sheet1")
ComboBox1.Clear

ComboBox1.AddItem "Fichte/Lärche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

End With

End Sub



Toppers Wrote:
See my second reply.

"honoluluzulu" wrote:


this is true, but is there a possibility to fill the combobox by

opening
the file ?!
so i have to switch to sheet 2 and return to sheet 1 - this is not a
good solution....

Toppers Wrote:
Works OK for me (XL2003). And yours worked if you ativate the sheet

by
sitching to sheet2 and then sheet1.

"honoluluzulu" wrote:


hi !

i have a problem with the filling of a comobobox.
first of all a code sniplet:


Private Sub Worksheet_Activate()

ComboBox1.Clear

ComboBox1.AddItem "Fichte/LÀrche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

ComboBox1.Text = ComboBox1.List(0)

End Sub

the problem:

if i open the excel file the combobox is empty or one entry is
inside
but the others are missing.

i can't imagine where the problem is.
the code is very simple and clear...

do anybody have an idea ?

if there are any questions plz take a look at the attached file




+-------------------------------------------------------------------+
|Filename: Testfall_A1_Bodenwert.zip
|
|Download: http://www.excelforum.com/attachment.php?postid=4359
|


+-------------------------------------------------------------------+

--
honoluluzulu


------------------------------------------------------------------------
honoluluzulu's Profile:
http://www.excelforum.com/member.php...o&userid=31569
View this thread:
http://www.excelforum.com/showthread...hreadid=512642




--
honoluluzulu

------------------------------------------------------------------------
honoluluzulu's Profile:

http://www.excelforum.com/member.php...o&userid=31569
View this thread:

http://www.excelforum.com/showthread...hreadid=512642




--
honoluluzulu
------------------------------------------------------------------------
honoluluzulu's Profile: http://www.excelforum.com/member.php...o&userid=31569
View this thread: http://www.excelforum.com/showthread...hreadid=512642

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default combobox filling problem


sorry my fault ;-)
i changed the source like this

Private Sub Workbook_Open()



Sheet1.ComboBox1.Clear

Sheet1.ComboBox1.AddItem "Fichte/Lärche"
Sheet1.ComboBox1.AddItem "Mischwald"
Sheet1.ComboBox1.AddItem "Laubwald"
Sheet1.ComboBox1.AddItem "Kiefer/Auwald"



End Sub

and here we go.. it works ;)

give thanks for support !

Toppers Wrote:
See my second reply.

"honoluluzulu" wrote:


this is true, but is there a possibility to fill the combobox by

opening
the file ?!
so i have to switch to sheet 2 and return to sheet 1 - this is not a
good solution....

Toppers Wrote:
Works OK for me (XL2003). And yours worked if you ativate the sheet

by
sitching to sheet2 and then sheet1.

"honoluluzulu" wrote:


hi !

i have a problem with the filling of a comobobox.
first of all a code sniplet:


Private Sub Worksheet_Activate()

ComboBox1.Clear

ComboBox1.AddItem "Fichte/LÀrche"
ComboBox1.AddItem "Mischwald"
ComboBox1.AddItem "Laubwald"
ComboBox1.AddItem "Kiefer/Auwald"

ComboBox1.Text = ComboBox1.List(0)

End Sub

the problem:

if i open the excel file the combobox is empty or one entry is
inside
but the others are missing.

i can't imagine where the problem is.
the code is very simple and clear...

do anybody have an idea ?

if there are any questions plz take a look at the attached file




+-------------------------------------------------------------------+
|Filename: Testfall_A1_Bodenwert.zip
|
|Download: http://www.excelforum.com/attachment.php?postid=4359
|


+-------------------------------------------------------------------+

--
honoluluzulu


------------------------------------------------------------------------
honoluluzulu's Profile:
http://www.excelforum.com/member.php...o&userid=31569
View this thread:
http://www.excelforum.com/showthread...hreadid=512642




--
honoluluzulu

------------------------------------------------------------------------
honoluluzulu's Profile:

http://www.excelforum.com/member.php...o&userid=31569
View this thread:

http://www.excelforum.com/showthread...hreadid=512642




--
honoluluzulu
------------------------------------------------------------------------
honoluluzulu's Profile: http://www.excelforum.com/member.php...o&userid=31569
View this thread: http://www.excelforum.com/showthread...hreadid=512642

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
filling a simple combobox cliodne[_8_] Excel Programming 5 December 5th 05 12:45 AM
Filling combobox with variable length list Denny Behnfeldt Excel Programming 3 January 2nd 05 06:31 PM
searching for a combobox.value and filling in textboxes from results GregJG[_18_] Excel Programming 3 July 8th 04 12:41 PM
Filling a ComboBox? CG Rosén Excel Programming 1 July 1st 04 02:33 AM
filling a combobox (without being prompted to save the workbook EVERY time its opened neowok[_34_] Excel Programming 2 March 1st 04 03:39 PM


All times are GMT +1. The time now is 09:24 PM.

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"