Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mr. Jay
 
Posts: n/a
Default I need major help fast!!!!!


Hello Everyone,

I am new to this post. I am stumped and figured I would ask the
gurus.

I am using VBA Excel to create a UserForm that will allow the user to
select a value from ComboBox1 and another Value from Combobox2 and
based on the two selections Textbox3 is populated with a message that I
define.

For Example: If the user choose China from Combox1 and USA from
Combobox2 Then the result display in Textbox3 would be "you will pay
taxes here after 184 days"

The problem is in column A and B of the spreadsheet I have 146
countries ( the fill for combo boxes 1&2), so to use an If..Than...Else
statement would be extremely labor intensive.

Could anyone help?


--
Mr. Jay
------------------------------------------------------------------------
Mr. Jay's Profile: http://www.excelforum.com/member.php...o&userid=32350
View this thread: http://www.excelforum.com/showthread...hreadid=521070

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default I need major help fast!!!!!

Maybe you can build a table.

Put the combobox1 values down column A and the combobox2 values across row 1.

Then you can use =index(match()) to retrieve the value.

You may want to read Debra Dalgleish's notes:
http://www.contextures.com/xlFunctions03.html

Look at examples 2 & 3.

"Mr. Jay" wrote:

Hello Everyone,

I am new to this post. I am stumped and figured I would ask the
gurus.

I am using VBA Excel to create a UserForm that will allow the user to
select a value from ComboBox1 and another Value from Combobox2 and
based on the two selections Textbox3 is populated with a message that I
define.

For Example: If the user choose China from Combox1 and USA from
Combobox2 Then the result display in Textbox3 would be "you will pay
taxes here after 184 days"

The problem is in column A and B of the spreadsheet I have 146
countries ( the fill for combo boxes 1&2), so to use an If..Than...Else
statement would be extremely labor intensive.

Could anyone help?

--
Mr. Jay
------------------------------------------------------------------------
Mr. Jay's Profile: http://www.excelforum.com/member.php...o&userid=32350
View this thread: http://www.excelforum.com/showthread...hreadid=521070


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Mr. Jay
 
Posts: n/a
Default I need major help fast!!!!!


Could you give please give me a little more detail as to how this might
work using VBA. I could set up my spreadsheet like you described.


--
Mr. Jay
------------------------------------------------------------------------
Mr. Jay's Profile: http://www.excelforum.com/member.php...o&userid=32350
View this thread: http://www.excelforum.com/showthread...hreadid=521070

  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default I need major help fast!!!!!

Option Explicit

Private Sub CommandButton1_Click()
Dim myRow As Variant
Dim myCol As Variant
Dim myRng As Range
Dim myVal As Variant

Set myRng = Worksheets("sheet99").Range("a1:x33") 'whatever you use here

myRow = Application.Match(ComboBox1.Value, myRng.Columns(1), 0)
myCol = Application.Match(ComboBox2.Value, myRng.Rows(1), 0)

If IsNumeric(myRow) _
And IsNumeric(myCol) Then
myVal = myRng.Cells(myRow, myCol).Value
Else
myVal = "Missing"
End If

MsgBox myVal
End Sub



"Mr. Jay" wrote:

Could you give please give me a little more detail as to how this might
work using VBA. I could set up my spreadsheet like you described.

--
Mr. Jay
------------------------------------------------------------------------
Mr. Jay's Profile: http://www.excelforum.com/member.php...o&userid=32350
View this thread: http://www.excelforum.com/showthread...hreadid=521070


--

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
searches slow on some computers fast on others? EdLeeYoung Excel Discussion (Misc queries) 1 August 4th 05 11:16 PM
Searches slow for some Fast for others? [email protected] Excel Worksheet Functions 0 August 4th 05 08:54 PM
how do I set up a fast comparison table? Biologist Excel Discussion (Misc queries) 1 June 21st 05 01:24 AM
Fast Fourier Transform Ad Pronk Excel Worksheet Functions 0 May 12th 05 11:38 AM
IS THERE A FAST WAY TO CHANGE THE ORDERS OF CONDITIONAL FORMATTIN. Mark_A_Cook Excel Discussion (Misc queries) 1 April 1st 05 06:43 AM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"