Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Update links macro

I have a workbook A comprising one worksheet that is linked to another
workbook B of six sheets; there are several links from A to each sheet in B.

Workbook B is generated by a macro on another workbook and saved down with
the same name so it overwrites the previous workbook B. However the sheet
names change slightly to reflect the date of creation; so the first sheet
will change from Sheet1Name+old date to Sheet1Name+new date and
Sheet2Name+old date to Sheet2Name +new date and so on.

I have workbook A open as i am running a macro already on that workbook and
then go to the other workbook to run a macro to create a new workbook B. How
do i get workbook A to update all the links automatically to the new workbook
B. I can get to the dialogue box 'Select Sheet' 'select the sheet to link
to:' Is it possible to use a macro to select each sheet in turn in the
dialogue box.

If it is possible i will be really grateful for the relevant code.

Many thanks
--
with kind regards

Spike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Update links macro

maybe you could use some code like this to create your link based on the sheet
name instead of hard coding it
sheets(1) is the first sheet, so if the order is always the same, the name won't
matter.


nm = Sheets(1).Name
Sheets("sheet2").Range("a2").Formula = "='" & nm & "'!" & "A4"

if the sheet name (nm) changes, the formula still works
--


Gary


"Spike" wrote in message
...
I have a workbook A comprising one worksheet that is linked to another
workbook B of six sheets; there are several links from A to each sheet in B.

Workbook B is generated by a macro on another workbook and saved down with
the same name so it overwrites the previous workbook B. However the sheet
names change slightly to reflect the date of creation; so the first sheet
will change from Sheet1Name+old date to Sheet1Name+new date and
Sheet2Name+old date to Sheet2Name +new date and so on.

I have workbook A open as i am running a macro already on that workbook and
then go to the other workbook to run a macro to create a new workbook B. How
do i get workbook A to update all the links automatically to the new workbook
B. I can get to the dialogue box 'Select Sheet' 'select the sheet to link
to:' Is it possible to use a macro to select each sheet in turn in the
dialogue box.

If it is possible i will be really grateful for the relevant code.

Many thanks
--
with kind regards

Spike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Update links macro

Sounds very good to me, i think i follow what you say which is very clever,
would you then get the macro to stick that (adapted of course for each link
etc) = "='" & nm & "'!" & "A4" (relevant cell ref)
into each cell which currently has an Excel formula in namely = path &
workbookname & sheet etc & A4


--
with kind regards

Spike


"Gary Keramidas" wrote:

maybe you could use some code like this to create your link based on the sheet
name instead of hard coding it
sheets(1) is the first sheet, so if the order is always the same, the name won't
matter.


nm = Sheets(1).Name
Sheets("sheet2").Range("a2").Formula = "='" & nm & "'!" & "A4"

if the sheet name (nm) changes, the formula still works
--


Gary


"Spike" wrote in message
...
I have a workbook A comprising one worksheet that is linked to another
workbook B of six sheets; there are several links from A to each sheet in B.

Workbook B is generated by a macro on another workbook and saved down with
the same name so it overwrites the previous workbook B. However the sheet
names change slightly to reflect the date of creation; so the first sheet
will change from Sheet1Name+old date to Sheet1Name+new date and
Sheet2Name+old date to Sheet2Name +new date and so on.

I have workbook A open as i am running a macro already on that workbook and
then go to the other workbook to run a macro to create a new workbook B. How
do i get workbook A to update all the links automatically to the new workbook
B. I can get to the dialogue box 'Select Sheet' 'select the sheet to link
to:' Is it possible to use a macro to select each sheet in turn in the
dialogue box.

If it is possible i will be really grateful for the relevant code.

Many thanks
--
with kind regards

Spike




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Update links macro

post back if you run into any issues

--


Gary


"Spike" wrote in message
...
Sounds very good to me, i think i follow what you say which is very clever,
would you then get the macro to stick that (adapted of course for each link
etc) = "='" & nm & "'!" & "A4" (relevant cell ref)
into each cell which currently has an Excel formula in namely = path &
workbookname & sheet etc & A4


--
with kind regards

Spike


"Gary Keramidas" wrote:

maybe you could use some code like this to create your link based on the
sheet
name instead of hard coding it
sheets(1) is the first sheet, so if the order is always the same, the name
won't
matter.


nm = Sheets(1).Name
Sheets("sheet2").Range("a2").Formula = "='" & nm & "'!" & "A4"

if the sheet name (nm) changes, the formula still works
--


Gary


"Spike" wrote in message
...
I have a workbook A comprising one worksheet that is linked to another
workbook B of six sheets; there are several links from A to each sheet in
B.

Workbook B is generated by a macro on another workbook and saved down with
the same name so it overwrites the previous workbook B. However the sheet
names change slightly to reflect the date of creation; so the first sheet
will change from Sheet1Name+old date to Sheet1Name+new date and
Sheet2Name+old date to Sheet2Name +new date and so on.

I have workbook A open as i am running a macro already on that workbook and
then go to the other workbook to run a macro to create a new workbook B.
How
do i get workbook A to update all the links automatically to the new
workbook
B. I can get to the dialogue box 'Select Sheet' 'select the sheet to link
to:' Is it possible to use a macro to select each sheet in turn in the
dialogue box.

If it is possible i will be really grateful for the relevant code.

Many thanks
--
with kind regards

Spike






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Update links macro

in some applications, i need to build the formulas on the fly, so they're in an
auto_open macro. when the workbook is opened, the relevant formulas are created.

--


Gary


"Spike" wrote in message
...
Sounds very good to me, i think i follow what you say which is very clever,
would you then get the macro to stick that (adapted of course for each link
etc) = "='" & nm & "'!" & "A4" (relevant cell ref)
into each cell which currently has an Excel formula in namely = path &
workbookname & sheet etc & A4


--
with kind regards

Spike


"Gary Keramidas" wrote:

maybe you could use some code like this to create your link based on the
sheet
name instead of hard coding it
sheets(1) is the first sheet, so if the order is always the same, the name
won't
matter.


nm = Sheets(1).Name
Sheets("sheet2").Range("a2").Formula = "='" & nm & "'!" & "A4"

if the sheet name (nm) changes, the formula still works
--


Gary


"Spike" wrote in message
...
I have a workbook A comprising one worksheet that is linked to another
workbook B of six sheets; there are several links from A to each sheet in
B.

Workbook B is generated by a macro on another workbook and saved down with
the same name so it overwrites the previous workbook B. However the sheet
names change slightly to reflect the date of creation; so the first sheet
will change from Sheet1Name+old date to Sheet1Name+new date and
Sheet2Name+old date to Sheet2Name +new date and so on.

I have workbook A open as i am running a macro already on that workbook and
then go to the other workbook to run a macro to create a new workbook B.
How
do i get workbook A to update all the links automatically to the new
workbook
B. I can get to the dialogue box 'Select Sheet' 'select the sheet to link
to:' Is it possible to use a macro to select each sheet in turn in the
dialogue box.

If it is possible i will be really grateful for the relevant code.

Many thanks
--
with kind regards

Spike








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Update links macro

Thank you very much for your help works ok from this end, really grateful,
off for the weekend now will jproperly code it all up on monday and i am sure
will be fine, but appreciate your help.
--
with kind regards

Spike


"Gary Keramidas" wrote:

in some applications, i need to build the formulas on the fly, so they're in an
auto_open macro. when the workbook is opened, the relevant formulas are created.

--


Gary


"Spike" wrote in message
...
Sounds very good to me, i think i follow what you say which is very clever,
would you then get the macro to stick that (adapted of course for each link
etc) = "='" & nm & "'!" & "A4" (relevant cell ref)
into each cell which currently has an Excel formula in namely = path &
workbookname & sheet etc & A4


--
with kind regards

Spike


"Gary Keramidas" wrote:

maybe you could use some code like this to create your link based on the
sheet
name instead of hard coding it
sheets(1) is the first sheet, so if the order is always the same, the name
won't
matter.


nm = Sheets(1).Name
Sheets("sheet2").Range("a2").Formula = "='" & nm & "'!" & "A4"

if the sheet name (nm) changes, the formula still works
--


Gary


"Spike" wrote in message
...
I have a workbook A comprising one worksheet that is linked to another
workbook B of six sheets; there are several links from A to each sheet in
B.

Workbook B is generated by a macro on another workbook and saved down with
the same name so it overwrites the previous workbook B. However the sheet
names change slightly to reflect the date of creation; so the first sheet
will change from Sheet1Name+old date to Sheet1Name+new date and
Sheet2Name+old date to Sheet2Name +new date and so on.

I have workbook A open as i am running a macro already on that workbook and
then go to the other workbook to run a macro to create a new workbook B.
How
do i get workbook A to update all the links automatically to the new
workbook
B. I can get to the dialogue box 'Select Sheet' 'select the sheet to link
to:' Is it possible to use a macro to select each sheet in turn in the
dialogue box.

If it is possible i will be really grateful for the relevant code.

Many thanks
--
with kind regards

Spike






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
update links when Macro ends Gato Excel Programming 0 February 21st 06 07:09 PM
Excel Macro - Auto Update Links joopdog Excel Programming 2 February 8th 06 07:58 PM
Macro after Update of Links Mr.T[_2_] Excel Programming 0 November 22nd 05 10:16 AM
Update links to other workbooks while running macro [email protected] Excel Programming 5 July 28th 05 06:17 AM
How do I set up a macro to automatically update links upon openin. MikeJoyner Excel Programming 1 January 6th 05 07:43 PM


All times are GMT +1. The time now is 11:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"