Macro - change link

  • Thread starter Thread starter DAA
  • Start date Start date
D

DAA

I posted this yesterday under "Link - Absolute reference".
Unfortunately, the response below did not work.

Please help!


DAA,

WorkbookName = "whatever.xls"

"=+'C:\DAta\[" & WorkbookName & "]INFO'!B2"

Utterly untested, but I think it's right.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------
I have a template workbook(1) that is linked to another
workbook(2).

Lets say in WB(1) Sheet1 A1 refers to WB(2) Sheet2 B2.

So in WB(1) Sheet1 A1 = I made a macro to EDIT $B$2 to be
a relative reference = "=+'C:\DAta\[wb(2).xls]INFO'!B2" so
I can copy a wide range. I made a macro to run the whole
process. My problem is, if I link WB(1) to another
workbook, because of changing from absolute to relative
reference:
= ActiveCell.FormulaR1C1 = "'C:\Data\[wb(2).xls = R[-10]C"
it will always refer to WB(2)! Is there a way that I can
write a macro that will also change the new link (i.e., WB
(3), WB(4), etc.)?

Thanks
 
What happened when you tried it?
I posted this yesterday under "Link - Absolute reference".
Unfortunately, the response below did not work.

Please help!


DAA,

WorkbookName = "whatever.xls"

"=+'C:\DAta\[" & WorkbookName & "]INFO'!B2"

Utterly untested, but I think it's right.
 
Message box: Compile error or Syntax error?!
-----Original Message-----
What happened when you tried it?
I posted this yesterday under "Link - Absolute reference".
Unfortunately, the response below did not work.

Please help!


DAA,

WorkbookName = "whatever.xls"

"=+'C:\DAta\[" & WorkbookName & "]INFO'!B2"

Utterly untested, but I think it's right.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

.
 
It worked! After editing the macro, it worked!
-----Original Message-----
Message box: Compile error or Syntax error?!
-----Original Message-----
What happened when you tried it?
I posted this yesterday under "Link - Absolute reference".
Unfortunately, the response below did not work.

Please help!


DAA,

WorkbookName = "whatever.xls"

"=+'C:\DAta\[" & WorkbookName & "]INFO'!B2"

Utterly untested, but I think it's right.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

.
.
 
Great!
(Sometimes you have to hold the hammer just right, when you whack it.)
It worked! After editing the macro, it worked!

-----Original Message-----
Message box: Compile error or Syntax error?!
-----Original Message-----
What happened when you tried it?

DAA wrote:

I posted this yesterday under "Link - Absolute
reference".

Unfortunately, the response below did not work.

Please help!


DAA,

WorkbookName = "whatever.xls"

"=+'C:\DAta\[" & WorkbookName & "]INFO'!B2"

Utterly untested, but I think it's right.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

.

.
 
Back
Top