Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Show cross-referenced value from 2 combo boxes

Hi!

I'm an Access programmer that has been asked to do a small project in Excel
and could use some assistance.

We have a spreadsheet containing "speeds" that are cross-referenced by
column headings of "material" and row headings of "size". They are wanting
to use a form with 2 combo boxes to select "material" and "size" and then
display the "speed". Only the form should be visible to prevent tampering
with the data behind it.

Could do this with a form and query in Access in about 60 seconds, but I've
never worked with Excel forms and controls. It must be Excel so that it can
be distributed to remote staff that can't connect to our DB and who don't
have Access.

Have tried using manual entries into cells with combinations of VLookup and
HLookup, but can't get results needed. Can someone point me to a resource
(sample code, tutorial, etc.) that will show me how to accomplish this?

Thanks,
Bruce
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Show cross-referenced value from 2 combo boxes


I wouldn't do this with a Query. Instead I would use a recordset a put
the results into a form in excel. The query would require a copy of the
data from the database to be put into an excel spreadsheet which you
don't want.

The code of getting the recordset would be exactly the same code you
would use in Access VBA. The only thing you would need to do is to
declare to references in the Excel VBA menu Tools - References


1) Microsoft Access 11.0 object library (or latest on your PC)
2) Microsoft ActiveX Data Object 2.8 library (or latest on your PC)


You can extract the data from the recordset and then place the into the
userform. You will only need help with creating the excel userform
since the record ocde will be exactly like access.


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=153096

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Show cross-referenced value from 2 combo boxes

Thanks for replying, Joel, but this has to be a totally "stand-alone" item.
No way to connect to the database here. The spreadsheet must run anywhere.
Bruce

"joel" wrote:


I wouldn't do this with a Query. Instead I would use a recordset a put
the results into a form in excel. The query would require a copy of the
data from the database to be put into an excel spreadsheet which you
don't want.

The code of getting the recordset would be exactly the same code you
would use in Access VBA. The only thing you would need to do is to
declare to references in the Excel VBA menu Tools - References


1) Microsoft Access 11.0 object library (or latest on your PC)
2) Microsoft ActiveX Data Object 2.8 library (or latest on your PC)


You can extract the data from the recordset and then place the into the
userform. You will only need help with creating the excel userform
since the record ocde will be exactly like access.


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=153096

Microsoft Office Help

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Show cross-referenced value from 2 combo boxes

Bruce,

I'm not exactly sure how your data is set up, but I've provided an example
below that may allow you to utilize native Excel before looking into creating
a User Form. You can protect cells within the worksheet to prevent users
from changing unwanted cells (i.e. the crosstab data).

All cell entries are simply entered into the spreadsheet.
B1: AAA
C1: BBB
D1: CCC

A2: Small
A3: Medium
A4: Large

B2: 1; C2: 4; D2: 7
B3: 2; C3: 5; D3: 8
B4: 3; C4: 6; D4: 9

Formula Data:
F1: Material
F2: Size
F3: Speed

User Input:
G1: CCC
G2: Large

Formula:
G3: =HLOOKUP(G1,$B$1:$D$4,MATCH(G2,$A$2:$A$4,0)+1,FALS E)

The user can change cells G1 and G2 to get the desired intersection. Let me
know if this is what you are looking to do; otherwise, I'll help get you on
the right track with the User Form and its Controls. (The above formula is
simply one way to do this. Other formulas that are related or can be used
are LOOKUP, VLOOKUP, and INDEX). The formula shoule return "9", i.e. the
intersection of CCC and Large.

Best,

Matthew Herbert



"BruceS" wrote:

Hi!

I'm an Access programmer that has been asked to do a small project in Excel
and could use some assistance.

We have a spreadsheet containing "speeds" that are cross-referenced by
column headings of "material" and row headings of "size". They are wanting
to use a form with 2 combo boxes to select "material" and "size" and then
display the "speed". Only the form should be visible to prevent tampering
with the data behind it.

Could do this with a form and query in Access in about 60 seconds, but I've
never worked with Excel forms and controls. It must be Excel so that it can
be distributed to remote staff that can't connect to our DB and who don't
have Access.

Have tried using manual entries into cells with combinations of VLookup and
HLookup, but can't get results needed. Can someone point me to a resource
(sample code, tutorial, etc.) that will show me how to accomplish this?

Thanks,
Bruce

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Show cross-referenced value from 2 combo boxes

Matthew,

Looks like this will do it! I'll give it a shot.
Many thanks!!

Bruce

"Matthew Herbert" wrote:

Bruce,

I'm not exactly sure how your data is set up, but I've provided an example
below that may allow you to utilize native Excel before looking into creating
a User Form. You can protect cells within the worksheet to prevent users
from changing unwanted cells (i.e. the crosstab data).

All cell entries are simply entered into the spreadsheet.
B1: AAA
C1: BBB
D1: CCC

A2: Small
A3: Medium
A4: Large

B2: 1; C2: 4; D2: 7
B3: 2; C3: 5; D3: 8
B4: 3; C4: 6; D4: 9

Formula Data:
F1: Material
F2: Size
F3: Speed

User Input:
G1: CCC
G2: Large

Formula:
G3: =HLOOKUP(G1,$B$1:$D$4,MATCH(G2,$A$2:$A$4,0)+1,FALS E)

The user can change cells G1 and G2 to get the desired intersection. Let me
know if this is what you are looking to do; otherwise, I'll help get you on
the right track with the User Form and its Controls. (The above formula is
simply one way to do this. Other formulas that are related or can be used
are LOOKUP, VLOOKUP, and INDEX). The formula shoule return "9", i.e. the
intersection of CCC and Large.

Best,

Matthew Herbert



"BruceS" wrote:

Hi!

I'm an Access programmer that has been asked to do a small project in Excel
and could use some assistance.

We have a spreadsheet containing "speeds" that are cross-referenced by
column headings of "material" and row headings of "size". They are wanting
to use a form with 2 combo boxes to select "material" and "size" and then
display the "speed". Only the form should be visible to prevent tampering
with the data behind it.

Could do this with a form and query in Access in about 60 seconds, but I've
never worked with Excel forms and controls. It must be Excel so that it can
be distributed to remote staff that can't connect to our DB and who don't
have Access.

Have tried using manual entries into cells with combinations of VLookup and
HLookup, but can't get results needed. Can someone point me to a resource
(sample code, tutorial, etc.) that will show me how to accomplish this?

Thanks,
Bruce



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Show cross-referenced value from 2 combo boxes

Matthew,
Just wanted you to know it worked great! Thanks!!
Bruce

"Matthew Herbert" wrote:

Bruce,

I'm not exactly sure how your data is set up, but I've provided an example
below that may allow you to utilize native Excel before looking into creating
a User Form. You can protect cells within the worksheet to prevent users
from changing unwanted cells (i.e. the crosstab data).

All cell entries are simply entered into the spreadsheet.
B1: AAA
C1: BBB
D1: CCC

A2: Small
A3: Medium
A4: Large

B2: 1; C2: 4; D2: 7
B3: 2; C3: 5; D3: 8
B4: 3; C4: 6; D4: 9

Formula Data:
F1: Material
F2: Size
F3: Speed

User Input:
G1: CCC
G2: Large

Formula:
G3: =HLOOKUP(G1,$B$1:$D$4,MATCH(G2,$A$2:$A$4,0)+1,FALS E)

The user can change cells G1 and G2 to get the desired intersection. Let me
know if this is what you are looking to do; otherwise, I'll help get you on
the right track with the User Form and its Controls. (The above formula is
simply one way to do this. Other formulas that are related or can be used
are LOOKUP, VLOOKUP, and INDEX). The formula shoule return "9", i.e. the
intersection of CCC and Large.

Best,

Matthew Herbert



"BruceS" wrote:

Hi!

I'm an Access programmer that has been asked to do a small project in Excel
and could use some assistance.

We have a spreadsheet containing "speeds" that are cross-referenced by
column headings of "material" and row headings of "size". They are wanting
to use a form with 2 combo boxes to select "material" and "size" and then
display the "speed". Only the form should be visible to prevent tampering
with the data behind it.

Could do this with a form and query in Access in about 60 seconds, but I've
never worked with Excel forms and controls. It must be Excel so that it can
be distributed to remote staff that can't connect to our DB and who don't
have Access.

Have tried using manual entries into cells with combinations of VLookup and
HLookup, but can't get results needed. Can someone point me to a resource
(sample code, tutorial, etc.) that will show me how to accomplish this?

Thanks,
Bruce

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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
Combo Box Values Not Sticking & Mult/ Combo Boxes in a WorkSheet questor Excel Programming 0 September 15th 08 01:38 AM
Creating a formula to find a range for a cross-referenced value Fay Roberts Excel Worksheet Functions 1 February 22nd 08 04:12 PM
Selecting subsets using combo boxes or list boxes CLamar Excel Discussion (Misc queries) 0 June 1st 06 07:43 PM
How can I return a cross referenced cell value? JR Excel Worksheet Functions 5 August 15th 05 11:37 PM


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