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 February 22nd, 2006, 06:46 AM
Authorized User
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Autoupdate multiple information

I have an excel sheet which contains details of several ships such as fuel consumption, speed, tons, no. of cranes etc. based on which I have to perform certain calculations. The above details are entered into the sheet manually inorder to calculate the maximum amount of cargo that I can load on that ship. So, at the top of the sheet I made a drop down list of the names of all the ships. I am trying to make all the data underneath to change to their respective ships' particulars based on the selection at the top.

I would appreciate if someone could help me with this.

Thanks

Ihsan

 
Old February 22nd, 2006, 08:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 173
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Ihsan,

This is a fairly standard modelling exercise. Thae basics of which are to have an input sheet (could be multiple input sheets but we don't want to confuse the example) which is a block table of information on every ship. It should look something along the lines of:

ID Ship Name Speed Tons ...
01 Bravo 10 1000 ...
02 Delta 20 1500 ...
03 Tango 50 50000 ...
...

depending on what data you've got. Then on a separate calculation sheet you want to pull information for a specific ship off the table. The best way to do this is to have a couter input cell at the top of the calculation sheet which can be set to a number. Then below the counter input cell you pull the set of information for any one ship through by using a series of INDEX formulae. i.e. to get the Ship Name you'd type the following formula (assuming the input table was the above demonstrated table and was found on cells A1:D4 of sheet Inputs and that the counter cell was in cell A1 of the current sheet) :
Code:
=INDEX(Inputs!A1:D4,$A$1+1,2)
With this method you can dynamically pull through the inputs for any one ship by amending the counter cell and these one-ship specific set of inputs can then be linked up to a set of ship specific calcs to give whatever answer you need for particular ships.

Hope this helps,
Maccas

 
Old February 23rd, 2006, 07:40 AM
Authorized User
 
Join Date: Jun 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a bunch! That really helped.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple workgroup information file dilemna Bob Bedell Access 4 January 7th, 2006 03:53 AM
Importing Multiple files in Multiple tables Versi Suomi Access 6 June 1st, 2005 08:47 AM
Multiple ADO multiple user login Oracle9i jhay0721 Pro VB Databases 1 April 4th, 2005 11:23 AM
Multiple Joins in Multiple Table Search query pookster Access 4 September 23rd, 2004 03:04 PM
Updating multiple Rows from multiple fields in ASP vdm_nana SQL Server ASP 0 April 1st, 2004 04:26 AM





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