Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2007, 10:20 AM
Registered User
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cascading Combo Boxes in Excel 2007

Hi All:

I have a workbook with 2 worksheets (PrimaryCare and PCSlicers). PrimaryCare has 4 combo boxes that receive their content from parameterised MicosoftQueries on sheet PCSlicers.

Cell A7 on PrimaryCare contains the most current selection of the 4 combo boxes.

To keep everything in sync I used the following code in Excel 2003:

Private Sub cboxClinic_Change()

End Sub

Private Sub cboxDivision_Change()
 Worksheets("PCSlicers").Range("ClinicInput") = Worksheets("PrimaryCare").OLEObjects("cboxDivision ").Object.Value
 Worksheets("PCSlicers").Range("ClinicInput").Copy Range("A7")

End Sub

Private Sub cboxFacility_Change()
 Worksheets("PCSlicers").Range("DivisionInput") = Worksheets("PrimaryCare").OLEObjects("cboxFacility ").Object.Value
 Worksheets("PrimaryCare").OLEObjects("cboxDivision ").Object.Value = Worksheets("PCSlicers").Range("DivisionInput")
 Worksheets("PCSlicers").Range("DivisionInput").Cop y Range("A7")

End Sub

Private Sub cboxVISN_Change()
 Worksheets("PCSlicers").Range("FacilityInput") = Worksheets("PrimaryCare").OLEObjects("cboxVISN").O bject.Value
 Worksheets("PrimaryCare").OLEObjects("cboxFacility ").Object.Value = Worksheets("PCSlicers").Range("FacilityInput")
 Worksheets("PCSlicers").Range("FacilityInput").Cop y Range("A7")

End Sub

This code does not work in Excel 2007 - gets into a loop.

Can someone suggest an Excel 2007 solution?

Thanks







Similar Threads
Thread Thread Starter Forum Replies Last Post
Cascading Combo Box Maureen227 Access 2 May 30th, 2006 05:42 AM
3 combo boxes ttkt Beginning PHP 0 July 2nd, 2005 02:20 PM
Cascading combo lists in continuous forms rjd97c Access 1 June 30th, 2004 02:51 PM
Combo boxes socoolbrewster Access 1 March 4th, 2004 09:28 AM
Combo Boxes tjs206 VB Databases Basics 2 December 10th, 2003 05:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.