MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 9th, 2006, 04:26 PM   #1
kristenrice
 
Join Date: Mar 2006
Posts: 8
Default new to excel 2003,don't know best way to create storage list

ok...I am new to Excel 2003..I know basics but not even a 1/100th of what the program can do....oh..i'm using windows XP...I am workind on creating a storage list for this company I just started working for. I have box numbers, a short description and then a long description. The long descriptions are actuall names and numbers of contracts averaging about 50-70 a box... I want to be able to have a master workbook with a mastersheet for each department with the box numbers and short description (that I can do!)...Next I want to creat a seperate workbook for each department that has several worksheets in it coorosponding to each box for that department...what I don't know how to do is make it so I can open the first workbook, say the water and sewer worksheet and click on the cell for box 124 that will automatically open appropriate worksheet from the corrosponding departments' workbook...

Again I know this is basic for you all I'm sure you've already answered this in some way somewhere on here, and I would gladly search but I don't know what to search for Please forgive my ignorance! Can anyone help??
__________________
Thanks,
Kristen
kristenrice is offline   Reply With Quote
Old Mar 10th, 2006, 11:47 AM   #2
lozzablake
 
Join Date: Dec 2005
Posts: 798
Default

This is possible, but you will need to have the exact file name, location and sheetname set up so that the macro can read in the data and then open the appropriate workbook and select the correct sheet. Can you post a sample of the master spreadsheet so we can see the data structure (use HTML maker)?
lozzablake is offline   Reply With Quote
Old Mar 10th, 2006, 12:51 PM   #3
Barry Katcher
 
Barry Katcher's Avatar
 
Join Date: Feb 2002
Location: Dog Beach, Florida. Yeaahh!
Posts: 4,018
Default

Hi, Kristen. Welcome to the Bored.

Select a cell in your master workbook. From the menu, choose Insert>Hyperlink. In the dialogue box, on the left, click on Existing File or Web Page. On the right, click on Browse for: File and in the new window, navigate to the file you want to link to and double-click. Back in the dialogue box, at top, you can specify the text for the link in the Text to display box. Click O.K., and you should have a text link that, when clicked, will open the workbook you want to go to.
__________________
Barry-

Photo Restoration/Enhancement

http://www.smiledogproductions.com
click below for detour

Barry Katcher is offline   Reply With Quote
Old Mar 10th, 2006, 01:32 PM   #4
lozzablake
 
Join Date: Dec 2005
Posts: 798
Default

The hyperlink will open the workbook, but it will not select a specific sheet. Does that work for you?
lozzablake is offline   Reply With Quote
Old Mar 10th, 2006, 01:56 PM   #5
Barry Katcher
 
Barry Katcher's Avatar
 
Join Date: Feb 2002
Location: Dog Beach, Florida. Yeaahh!
Posts: 4,018
Default

To go to a particular sheet/cell, place this code in the "This Workbook" module in each of the subsidiary workbooks:

Code:
Private Sub Workbook_Open()
    Sheets("Sheet3").Select 'change sheet name to suit
    Range("A1").Select  'change cell address to suit
End Sub
__________________
Barry-

Photo Restoration/Enhancement

http://www.smiledogproductions.com
click below for detour

Barry Katcher is offline   Reply With Quote
Old Mar 10th, 2006, 02:28 PM   #6
kristenrice
 
Join Date: Mar 2006
Posts: 8
Default

ok...First of all thanks for the help...now...I understand the hyperlink part. where you lost me what the

Quote:
o go to a particular sheet/cell, place this code in the "This Workbook" module in each of the subsidiary workbooks:

Code:
Private Sub Workbook_Open()
Sheets("Sheet3").Select 'change sheet name to suit
Range("A1").Select 'change cell address to suit
End Sub
What is the "this workbook" module....I'm assuming the reference to "this workbook" is the name of the workbook I want to open.. is the Module a macro...and yes if you haven't guessed already welcome to I've never done a macro...sorry for the stupid questions...

Thanks again..
__________________
Thanks,
Kristen
kristenrice is offline   Reply With Quote
Old Mar 10th, 2006, 02:51 PM   #7
Barry Katcher
 
Barry Katcher's Avatar
 
Join Date: Feb 2002
Location: Dog Beach, Florida. Yeaahh!
Posts: 4,018
Default

Kristen, modules are sort of like folders within Visual Basic that hold macros/code. The code above is a macro that is performed automatically whenever the workbook that it is in is opened. It has to go in the "ThisWorkbook" module,which applies to the entire workbook, as opposed to one of the Sheet modules, which are sheet-specific. Anyway, here's a step-by-step of how to get it into the workbook.

1. Copy the code above to the clipboard.
2. Open one of your "department" workbooks.
3. From the menu, choose Tools>Macros>Visual Basic Editor.
4. On the left, in "Project-VBA Project" window, double-click on ThisWorkbook module.
5. Click on the large screen on the right, then right-click and Paste the code.
6. Change the sheet name and the cell address in the code to where you want to open the workbook at. Shown in red below.
----->Sheets("Sheet3").Select
----->Range("A1").Select
7. Close the Visual Basic window and save the workbook.

The next time you open the workbook, either manually or via the link in the master workbook, it will automatically go to the sheet and range that you specify.
__________________
Barry-

Photo Restoration/Enhancement

http://www.smiledogproductions.com
click below for detour

Barry Katcher is offline   Reply With Quote
Old Mar 10th, 2006, 03:16 PM   #8
kristenrice
 
Join Date: Mar 2006
Posts: 8
Default

Ok...I think I understand how that works...

but take for instance that the master workbook under my water and sewer department sheet has a box 1 and box 2 and so forth...if I put the code you suggest in the Department workbook if I click on the box 1 or the box 2 in the master workbook wouldn't it take me to the exact same place in the department workbook? I actually want to have seperate sheets per box so when I click on the box 1 in the master workbook on the department sheet water and sewer it would open the department's workbook and go to the appropriate sheet for that box...doesn't that mean I'd have to use the sheet modules??

Ok...and then again I may not understand this after I get this project out of the way I think I'm signing up for a class!!! But in the meantime thanks again for all your help!
__________________
Thanks,
Kristen
kristenrice is offline   Reply With Quote
Old Mar 10th, 2006, 03:32 PM   #9
Barry Katcher
 
Barry Katcher's Avatar
 
Join Date: Feb 2002
Location: Dog Beach, Florida. Yeaahh!
Posts: 4,018
Default

You're right, it would take you to the same place, regardless of which sheet/cell you want to go to.

Off the top of my head, I don't immediately have a fix for this, although I'm almost certain there's a way (probably several ways) to do what you want. Perhaps the Open macro taking you to a page with hyperlinks to the various sheets that can be clicked on. Perhaps code in the master workbook that take you to the specific workbook/sheet/cell.

I've just been handed a big project at work and can't research this right now, but keep the topic going; I'm certain someone else on the board can help you. I'll check back this evening and see if any progress has been made; if not, I'll jump back in.
__________________
Barry-

Photo Restoration/Enhancement

http://www.smiledogproductions.com
click below for detour

Barry Katcher is offline   Reply With Quote
Old Mar 10th, 2006, 03:56 PM   #10
Barry Katcher
 
Barry Katcher's Avatar
 
Join Date: Feb 2002
Location: Dog Beach, Florida. Yeaahh!
Posts: 4,018
Default

Here's code that you can place in any module in your master workbook, using the technique in my previous post. Change the path/sheet/cell to the appropriate subsidiary workbook path/sheet/cell.

Code:
Sub Macro1()
    Workbooks.Open Filename:="G:\Finance\FShare\Barry\Excel\Barry\Book1.xls"
    Sheets("Sheet2").Select
    Range("C14").Select
End Sub
Now, you'll go to the area in your master workbook that you want to place the link, and you'll draw a button, to which you'll assign the macro above.

1. From the menu, choose Tools>Customize.
2. In the "Customize" dialogue box, click on the "Toolbars" tab.
3. Tick the box for "Forms" and close the dialogue box.
4. You should now have the Forms toolbar on your screen.
5. Click the icon for "Button" (a little grey rectangle).
6. On your sheet, in the appropriate place, click-and-drag to draw a button.
7. In the "Assign Macro" dialogue box that appears, click on the appropriate macro, and click "O.K.".
8. With the button still selected (handles and a ::::: border), highlight the default text and overwrite it with your own text.
9. Click anywhere outside the button to deselect it.
10. Click on the button, and it should open the subsid workbook and go to the page and cell you specified in the macro.
__________________
Barry-

Photo Restoration/Enhancement

http://www.smiledogproductions.com
click below for detour

Barry Katcher is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT +1. The time now is 05:09 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
All contents Copyright 1998-2010 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes