Solved

Changing name of Workbooks

Posted on 2011-02-20
3
226 Views
Last Modified: 2012-05-11
Hi,
There are two workbooks that people work in each week.
I have done some VBA which is attached to a button in workbook 1.
I would like to pass some information from workbook 1 to workbook 2.
I have found some good advice on here how to do that, when the workbooks have a constant name.
My problem is that each week, "the powers that be", insist on saving the updated workbooks to include the week number. So each week the name of the workbooks change.
So workbook 1 is called for example "Plant 2 Performance Wk 5 2011", and workbook 2 is "Plant 2 Scoreboard Wk 5 2011", and each week the week number is incremented by 1 manually.

I don't mind the manual saving, (a database is being developed to replace these workbooks), but I would like to be able to open the "Plant 2 Scoreboard Wk ? 2011" from the button on Plant 2 Performance Wk ? 2011" where the week numbers match.
(both workbooks are in the same folder on a file server, and "Plant 2 Performance Wk ? 2011" is always opened and updated before "Plant 2 ScoreboardWk ? 2011" is opened.

As always any help is appreciated.
0
Comment
Question by:Stephen Byrom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 34936749
Perhaps using the workbook name i.e.

application.workbooks.open replace(thisworkbook.FullName, "Performance", "Scoreboard",,,vbTextCompare)

Assumes the code is in the performance workbook but if not simply reference the applicable workbook

Chris
0
 
LVL 1

Author Closing Comment

by:Stephen Byrom
ID: 34936766
Brilliant !!!
You come to my rescue yet again.
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 34936798
Always a pleasure to help

Chris
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question