Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
BLW BLW is offline
external usenet poster
 
Posts: 6
Default dropdown list help

i am using a dropdown list to show product names. when a product is selected
from the list, key information appears in the adjacent columns. what i need
to do now is make all the information write to the next line so that i can
select another product, which will then also write to the next line, making a
type of shopping list.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default dropdown list help

Here is a way to do what you want

I am assuming that the dropdown list bax is called ComboBox1 and is on
Sheet1 and has a linked cell property of A1 and has a list fill range of
K1:K6.

I am also assuming that there is a range K1:M6 where K1 through K6 are
product names and L1 to L6 and M1 to M6 are certain info about each product.

Use the following code for ComboBox1's change event

Private Sub ComboBox1_Change()
With Sheet1
lLastRowWithData = lLastRowWithData + 1
.Cells(lLastRowWithData, 2).Value = _
WorksheetFunction.VLookup(.Range("a1"), .Range("K1:M6"), 2, True)
.Cells(lLastRowWithData, 3).Value = _
WorksheetFunction.VLookup(.Range("a1"), .Range("K1:M6"), 3, True)
End With
End Sub

Also place the following declaration in the Declaration section of the sheet1.
You will need a button or some user initiated method which will set the
lLastRowWithData variable back to zero when the user wants to start again.

Alok Joshi


"BLW" wrote:

i am using a dropdown list to show product names. when a product is selected
from the list, key information appears in the adjacent columns. what i need
to do now is make all the information write to the next line so that i can
select another product, which will then also write to the next line, making a
type of shopping list.

  #3   Report Post  
Posted to microsoft.public.excel.programming
BLW BLW is offline
external usenet poster
 
Posts: 6
Default dropdown list help

i think one of the problems that i am giong to have for this is that there
are several categories for this list and so there are several listboxes...the
second and third listboxes would be dependent on how many things were
selected from the first listbox.

"Alok" wrote:

Here is a way to do what you want

I am assuming that the dropdown list bax is called ComboBox1 and is on
Sheet1 and has a linked cell property of A1 and has a list fill range of
K1:K6.

I am also assuming that there is a range K1:M6 where K1 through K6 are
product names and L1 to L6 and M1 to M6 are certain info about each product.

Use the following code for ComboBox1's change event

Private Sub ComboBox1_Change()
With Sheet1
lLastRowWithData = lLastRowWithData + 1
.Cells(lLastRowWithData, 2).Value = _
WorksheetFunction.VLookup(.Range("a1"), .Range("K1:M6"), 2, True)
.Cells(lLastRowWithData, 3).Value = _
WorksheetFunction.VLookup(.Range("a1"), .Range("K1:M6"), 3, True)
End With
End Sub

Also place the following declaration in the Declaration section of the sheet1.
You will need a button or some user initiated method which will set the
lLastRowWithData variable back to zero when the user wants to start again.

Alok Joshi


"BLW" wrote:

i am using a dropdown list to show product names. when a product is selected
from the list, key information appears in the adjacent columns. what i need
to do now is make all the information write to the next line so that i can
select another product, which will then also write to the next line, making a
type of shopping list.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default dropdown list help

You have to explain the full scope of the problem and someone can probably
come up with a solution.

Alok Joshi

"BLW" wrote:

i think one of the problems that i am giong to have for this is that there
are several categories for this list and so there are several listboxes...the
second and third listboxes would be dependent on how many things were
selected from the first listbox.

"Alok" wrote:

Here is a way to do what you want

I am assuming that the dropdown list bax is called ComboBox1 and is on
Sheet1 and has a linked cell property of A1 and has a list fill range of
K1:K6.

I am also assuming that there is a range K1:M6 where K1 through K6 are
product names and L1 to L6 and M1 to M6 are certain info about each product.

Use the following code for ComboBox1's change event

Private Sub ComboBox1_Change()
With Sheet1
lLastRowWithData = lLastRowWithData + 1
.Cells(lLastRowWithData, 2).Value = _
WorksheetFunction.VLookup(.Range("a1"), .Range("K1:M6"), 2, True)
.Cells(lLastRowWithData, 3).Value = _
WorksheetFunction.VLookup(.Range("a1"), .Range("K1:M6"), 3, True)
End With
End Sub

Also place the following declaration in the Declaration section of the sheet1.
You will need a button or some user initiated method which will set the
lLastRowWithData variable back to zero when the user wants to start again.

Alok Joshi


"BLW" wrote:

i am using a dropdown list to show product names. when a product is selected
from the list, key information appears in the adjacent columns. what i need
to do now is make all the information write to the next line so that i can
select another product, which will then also write to the next line, making a
type of shopping list.

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
dropdown list determined by another dropdown list Wackyracer Excel Discussion (Misc queries) 5 April 27th 09 10:49 PM
Excell Dropdown List. Display alternate text than found in list. Shawnn Excel Discussion (Misc queries) 14 December 11th 08 07:43 PM
Dropdown List - list item endings not visible if column too narrow AK9955 Excel Discussion (Misc queries) 2 April 27th 07 09:02 AM
result of selecting from the dropdown list should be a dropdown list No News Excel Worksheet Functions 0 July 5th 06 04:09 PM
result of selecting from the dropdown list should be a dropdown list No News Excel Worksheet Functions 2 July 1st 06 10:53 AM


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