Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 06-24-2014, 10:16 AM
jpb103's Avatar
jpb103 jpb103 is offline Using drop down boxes to access different data Windows 7 64bit Using drop down boxes to access different data Office 2007
Advanced Beginner
 
Join Date: May 2014
Location: Thunder Bay, Ontario
Posts: 58
jpb103 is on a distinguished road
Default

I don't see why not. Just make sure you include the reference in your project to the Microsoft Excel 12.0 (or whatever) Object Library (Tools->References...). Does each team have the same number of players? If so, you could do a loop, something like:
Code:
Dim i as integer
Dim wkbkTarget as Workbook
Set wkbkTarget = Excel.Workbooks.Open(C:\path\filename)
For i = 1 to 10 '//If there are 10 players//
    ComboPlayers.Additem wkbkTarget.Range.Cell("A", i)
Next i
I don't know about that exact syntax on the wkbkTarget.Range.Cell part (you might have to reference a specific worksheet) so you'll want to mess around with that probably. If each team doesn't have the same number of players you could always just keep a count in one of the cells on the excel sheet, then just retrieve it and put that into a PlayerCount variable (integer or long) at runtime.

Good luck.

Last edited by jpb103; 06-24-2014 at 12:19 PM.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
excel drop down boxes kaschlegel Excel 1 07-22-2013 10:23 PM
Using drop down boxes to access different data Changing the placeholder text for drop down boxes DeadBatteries Word 1 08-24-2012 09:09 AM
Using drop down boxes to access different data Data Validation drop down rkalapura Excel 1 05-27-2012 02:23 AM
Using drop down boxes to access different data Dynamically creating new drop down boxes. dmncs Word VBA 1 05-06-2012 09:29 PM
Using drop down boxes to access different data Drop Down Boxes Thomas Farmery Word 7 01-05-2011 01:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft