![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 232
|
Hi,
I have a user form, and need it to do two things that I don't know how to do. 1) When a value is selected from a combo box I need it to lookup an array and bring back the col2 value and display it on the user form and have it drop on the worksheet as the linked RowSource (I used a label contol on the dialogue box for this) 2) I need to create (I think) a function in VBA to times the value from the above control by a value value on the worksheet. HELP!! Thanks in advance MAtt |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Quote:
Private Sub ComboBox1_Change() Dim MyValue As String Dim MyLookup As Double Dim MyFinalValue As Double MyValue = ComboBox1.Value MyLookup = Application.WorksheetFunction.VLookup(MyValue, Sheet1.Range("A1:b10"), 2, 0) MyFinalValue = MyLookup * Sheet1.Range("c10").Value MsgBox MyFinalValue End Sub Change the Ranges and Combobox Name as required. Let me know if it's what you need.
__________________
"Have a good time......all the time" Ian Mac |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|