Creating a Footer that contains the value of a cell on another Workbook

Claire Jones

New Member
Joined
Mar 23, 2009
Messages
3
Hi All :)

I am new to this forum (and to VBA) and am hoping you will be able to help me.

I am trying to find a way of putting the value of a cell from a specified sheet in one workbook into the footer of another sheet in another workbook.

The below works if you want the value of a cell in the same workbook but I can't figure out how to do if you want the value of a cell from a different workbook.

ActiveSheet.PageSetup.LeftFooter = Range("a1").Value

I tried the below but it did not work. Do you have any ideas?.

Private Sub Workbook_BeforePrint(Cancel As Boolean)

Dim ftr As String
Application.Workbooks("Book 1.xls").Worksheets("Sheet 1").Range("a1").Value = ftr
ActiveSheet.PageSetup.LeftFooter = ftr

End Sub

For the purpose of this lets say I want to put the value of range A1 on Sheet 1 of a workbook named "master" into the left footer of Sheet 1 in a workbook named "Specification 1".

Your help really would be most appreciated.

Many thanks, hope to hear from you soon.


Claire
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to the Board.

Try:

ActiveSheet.PageSetup.LeftFooter = Workbooks("Book 1.xls").Worksheets("Sheet 1").Range("A1").Value
 
Upvote 0
If you get that error you need to check that a workbook named "Book 1.xls" is open and that it contains a worksheet named "Sheet 1" (no quotes in both cases).
 
Upvote 0
Just a thought really

Is it definitely "Sheet 1" or could it be "Sheet1" ?

This is the type of thing thats gets me every time

Mark:)
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top