Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with a dropdown list


In a dialog sheet I made a dropdown list of certain cells from another
worksheet called "Total Inventory" and I was wondering if I can create
a code so that whatever product is selected from the dropdown list, it
would show the current inventory (which would be found in the total
inventory worksheet) of that product inside a group box

If this is too vague let me know, and I'll be more specific


--
malik641
------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=378607

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with a dropdown list


maybe i do need to be more specific

whatever is selected from the dropdown list, I want to display certain
text from other cells in a label, thats all

Here's what I have:

Sub DropDown26_Change()
'R1 Inventory
If Reagent_Drop_Down = "='Total Inventory'!A5:A62" Then
R1 = "='Total Inventory'!C5:C62"
Else
R1 = ""
End If




End Sub

R1 is the Label name
I'm sure this is way off, but I haven't programmed in VB since high
school

so any help is greatly appreciated


--
malik641
------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=378607

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with a dropdown list


Am I asking a dumb question

--
malik64
-----------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...fo&userid=2419
View this thread: http://www.excelforum.com/showthread.php?threadid=37860

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Help with a dropdown list

I think that you haven't posted enough details.

If your inventory sheet has one row per part number, maybe just using =vlookup()
would be sufficient.

If your inventory has multiple rows per part, maybe =sumproduct() would work.

I assumed that you have one row per part number.

I put a button on the dialog and assigned it this macro:

Option Explicit
Sub testme()

Dim wks As Worksheet
Dim res As Variant
Dim myDD As DropDown
Dim myItem As String

Set wks = ThisWorkbook.Worksheets("Total Inventory")

Set myDD = ThisWorkbook.DialogSheets("dialog1").DropDowns("dr op down 1")

With myDD
If .ListIndex < 0 Then
Beep 'nothing selected
Else
myItem = .List(.ListIndex)
End If
End With

res = Application.VLookup(myItem, wks.Range("a:B"), 2, False)

If IsError(res) Then
res = 0
End If

ThisWorkbook.DialogSheets("dialog1").Labels("Label 1").Caption = res

End Sub

The other thing is that most people aren't familiar with dialogsheets (I'm
not!). If you're using xl97+, you may want to consider using UserForms.

malik641 wrote:

Am I asking a dumb question?

--
malik641
------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=378607


--

Dave Peterson
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:38 AM.

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"