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 Apr 6th, 2002, 06:05 PM   #1
diamond
New Member
 
Join Date: Apr 2002
Location: Vancouver Area, Canada
Posts: 21
Default

Hi

I created a buget and time sheet forms that used this formula. From page to page.

=SUM('1 Mar 02'!B1+14)

I would like to link the page tab to the cell that has this formula. Like that I don't have to write them by hand 26 times in my workbook. It is bad if I have to change the date on the first page. I require to manually change every tab.

Please give me a simple solution to this challenge. This is my first project.

Thanks a million.
diamond is offline   Reply With Quote
Old Apr 6th, 2002, 08:37 PM   #2
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

Please check this:

http://www.mrexcel.com/board/viewtop...c=2877&forum=2

I would be around if you need.
smozgur is offline   Reply With Quote
Old Apr 6th, 2002, 08:39 PM   #3
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

if those cells would never change (also tab names i mean) then you can just set the names at the opening of the doc or just once.

Please let me know what you need.
smozgur is offline   Reply With Quote
Old Apr 6th, 2002, 08:46 PM   #4
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

My second comment could be done with this code in ThisWorkbook Open Sub.

(Assume A1 had the tab name you want to set)


Private Sub Workbook_Open()
Dim wrkSheet As Worksheet
On Error Resume Next
For Each wrkSheet In ThisWorkbook.Worksheets
wrkSheet.Name = wrkSheet.Range("A1").Value
If Err Then
MsgBox "Name is not valid for " & wrkSheet.Name
End If
Next wrkSheet
End Sub

'To make sheet name changed by changing link value
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
If Target.Address = "$A$1" Then
Sh.Name = Target.Value
End If
If Err Then
MsgBox "Name is not valid"
End If
End Sub

smozgur is offline   Reply With Quote
Old Apr 7th, 2002, 09:23 AM   #5
diamond
New Member
 
Join Date: Apr 2002
Location: Vancouver Area, Canada
Posts: 21
Default

Thanks Smozgur

I try your first suggestion, it works with names and text but I'm using dates format.
04/07/2002 which is change to show 7-Apr-02.

The sheet tab show the pay day that I want.

I try to use an other cell by =A27 in cell BA27. The result is the same, it doesn't see the date.

Thanks for you help...
diamond is offline   Reply With Quote
Old Apr 7th, 2002, 09:39 AM   #6
Aladin Akyurek
MrExcel MVP
 
Aladin Akyurek's Avatar
 
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
Default

Quote:
On 2002-04-07 08:23, diamond wrote:
Thanks Smozgur

I try your first suggestion, it works with names and text but I'm using dates format.
04/07/2002 which is change to show 7-Apr-02.

The sheet tab show the pay day that I want.

I try to use an other cell by =A27 in cell BA27. The result is the same, it doesn't see the date.

Thanks for you help...
In BA27 enter:

=TEXT(A27,"d-mmm-yy")

to see if this works.
Aladin Akyurek is offline   Reply With Quote
Old Apr 7th, 2002, 10:35 AM   #7
diamond
New Member
 
Join Date: Apr 2002
Location: Vancouver Area, Canada
Posts: 21
Default

It works.

Now, the last challenge is that I have to click on the cell then click on the formula then the green check mark and it will update.
I forget to mention I'm working with 97 version.

So if I change A23 that is connected with A24 by A23+1 to change the date from Mon to Fri all the way to A27. It change everything the way it is suppose to even BA27 but it doesn't update the tab until I go in the formula of that cell (BA27)and get out again. Then it will see the change. It is like the macro doesn't update automatically.

Am I doing something wrong?

Thanks guys, I'm learning a lot.
diamond is offline   Reply With Quote
Old Apr 7th, 2002, 03:11 PM   #8
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

Hi,

You remember Change event?

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error Resume Next
If Target.Address = "$A$23" Then
Sh.Name = Target.Value
End If
If Err Then
MsgBox "Name is not valid"
End If
End Sub

Now you should change it like above. You should check for A23 cell changing.

regards
smozgur is offline   Reply With Quote
Old Apr 7th, 2002, 03:14 PM   #9
smozgur
BatCoder
 
Join Date: Feb 2002
Location: Turkey
Posts: 764
Default

I mean, you will check the being modified cell in SheetChange event.
smozgur is offline   Reply With Quote
Old Apr 10th, 2002, 11:17 PM   #10
diamond
New Member
 
Join Date: Apr 2002
Location: Vancouver Area, Canada
Posts: 21
Default

Hi

Sorry for not getting it.

I created a test sheet for this project of mine.

Here every step that I made.

Cell A3= Date Format 4/4/2002
Cell A4= A3+1
Cell A5= A4+1
Cell A6= A5+1
Cell A7= A6+1

Cell C7 = =TEXT(A7,"d-mmm-yy")


When I right click on the Sheet label and view code I see the VB page:
On the top left, I see:
Project-VBA Project

Bottom left, I see:
Properties-sheet1

On the right side, I see the macro window, I suppose:

Worksheet  Change 

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error Resume Next
If Target.Address = "$C$7" Then Sheet1.Name = Target
If Err Then Target = ActiveSheet.Name
End Sub

The only routine that works partially is the above one.

I still need to click on the formula in C7 then click green check mark and the sheet label changed.

When I change the date in A3, C7 update automatically but not the tab.

I tried your suggestions but I’m missing a point some were.

Don’t forget this is the first time that I go in VBA.

Thanks for your patience.




[ This Message was edited by: diamond on 2002-04-10 22:19 ]
diamond 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 -4. The time now is 01:36 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 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