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

Hi, i am trying to create a data entry form in excel, and i want a drop down
to select the company... i have the combo box set up, and set to its row
source, but i dont know how to get it to fill the rows in a column when a
company is selected!! i set the control source to "d2" and then it would only
fill d2... then when i left the control source blank, it didnt fill
anything!!!

this is the vbl i have for the rest of the form:

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text

MsgBox "One record written to Sheet1"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

TextBox1.SetFocus

Else
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
End
End Sub


Private Sub UserForm_Click()

End Sub


i have the form filling columns a,b and c... and i want the combo box to
fill column d.... how do i do that?

thanks!!

Emily
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default combo box problem!

Sheet1.Range("D50").Value = ComboBox1.Value
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"emmy128"

wrote in message
Hi, i am trying to create a data entry form in excel, and i want a drop down
to select the company... i have the combo box set up, and set to its row
source, but i dont know how to get it to fill the rows in a column when a
company is selected!! i set the control source to "d2" and then it would only
fill d2... then when i left the control source blank, it didnt fill
anything!!!
this is the vbl i have for the rest of the form:

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text

MsgBox "One record written to Sheet1"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

TextBox1.SetFocus

Else
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
End
End Sub


Private Sub UserForm_Click()

End Sub


i have the form filling columns a,b and c... and i want the combo box to
fill column d.... how do i do that?
thanks!!
Emily
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default combo box problem!

Hi,

Or this one:

if combobox1.value < "" then _
LastRow.Offset(1, 3).Value = combobox1.value

--

Regards,

Halim


"emmy128" wrote:

Hi, i am trying to create a data entry form in excel, and i want a drop down
to select the company... i have the combo box set up, and set to its row
source, but i dont know how to get it to fill the rows in a column when a
company is selected!! i set the control source to "d2" and then it would only
fill d2... then when i left the control source blank, it didnt fill
anything!!!

this is the vbl i have for the rest of the form:

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text

MsgBox "One record written to Sheet1"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

TextBox1.SetFocus

Else
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
End
End Sub


Private Sub UserForm_Click()

End Sub


i have the form filling columns a,b and c... and i want the combo box to
fill column d.... how do i do that?

thanks!!

Emily

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default combo box problem!

Jim, i put this in, and its only filling d50....???

"Jim Cone" wrote:

Sheet1.Range("D50").Value = ComboBox1.Value
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"emmy128"

wrote in message
Hi, i am trying to create a data entry form in excel, and i want a drop down
to select the company... i have the combo box set up, and set to its row
source, but i dont know how to get it to fill the rows in a column when a
company is selected!! i set the control source to "d2" and then it would only
fill d2... then when i left the control source blank, it didnt fill
anything!!!
this is the vbl i have for the rest of the form:

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text

MsgBox "One record written to Sheet1"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

TextBox1.SetFocus

Else
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
End
End Sub


Private Sub UserForm_Click()

End Sub


i have the form filling columns a,b and c... and i want the combo box to
fill column d.... how do i do that?
thanks!!
Emily

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default combo box problem!

Yes, that is what it does.
It is an example of placing the selected item from a combobox
onto a worksheet.
What do you want to happen when an item is selected in the combobox?

Do you want to place the entire list from the combobox onto the sheet?...
MyRange.Value = Combobox1.List

Do you want to fill a range with the selected item?...
MyRange.Value = Combobox1.Value

Note: MyRange is a single column range object with the same
number of cells as the number of items in the combobox.
--
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html



"emmy128"
wrote in message
Jim, i put this in, and its only filling d50....???



"Jim Cone" wrote:
Sheet1.Range("D50").Value = ComboBox1.Value
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default combo box problem!

Sounds like you are expecting Excel to know that you want it to look up some
extra information for you.
Maybe VLOOKUP is what you need.

NickHK

"emmy128" ...
Jim, i put this in, and its only filling d50....???

"Jim Cone" wrote:

Sheet1.Range("D50").Value = ComboBox1.Value
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"emmy128"

wrote in message
Hi, i am trying to create a data entry form in excel, and i want a drop
down
to select the company... i have the combo box set up, and set to its row
source, but i dont know how to get it to fill the rows in a column when a
company is selected!! i set the control source to "d2" and then it would
only
fill d2... then when i left the control source blank, it didnt fill
anything!!!
this is the vbl i have for the rest of the form:

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = TextBox1.Text
LastRow.Offset(1, 1).Value = TextBox2.Text
LastRow.Offset(1, 2).Value = TextBox3.Text

MsgBox "One record written to Sheet1"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""

TextBox1.SetFocus

Else
Unload Me
End If

End Sub

Private Sub CommandButton2_Click()
End
End Sub


Private Sub UserForm_Click()

End Sub


i have the form filling columns a,b and c... and i want the combo box to
fill column d.... how do i do that?
thanks!!
Emily



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
Combo box problem R Ormerod Excel Discussion (Misc queries) 1 August 14th 07 01:12 PM
Combo box problem R Ormerod Excel Discussion (Misc queries) 3 August 13th 07 09:52 AM
Combo Box problem tmjhiphopcom Excel Discussion (Misc queries) 2 November 6th 05 05:30 PM
Combo problem again filo666 Excel Programming 1 April 18th 05 07:13 PM
combo box problem filo666 Excel Programming 4 April 18th 05 04:59 PM


All times are GMT +1. The time now is 08:52 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"