Footer Linked Range (Multiple Cells)

Johnbrowning9

New Member
Joined
Mar 31, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I would like to be able to have a footer that is linked to a range on the same sheet (AL1:AM4). (If possible) Or if it is not able to, just a way to stack the cells and create multiple rows

The Current code I created allows me to do this but it is in a single line.

Example
1617207444011.png


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim Sh As Worksheet
For Each Sh In Me.Worksheets
Sh.PageSetup.LeftFooter = ActiveSheet.Range("AL1").Text + " " + ActiveSheet.Range("AL2").Text + " " + ActiveSheet.Range("AM2").Text + " " + ActiveSheet.Range("AL3").Text + " " + ActiveSheet.Range("AM3").Text + " " + ActiveSheet.Range("AL4").Text + " " + ActiveSheet.Range("AM4").Text


Next Sh
End Sub

I am trying to get it to look like this
1617207577062.png

I have no idea how to get them to stack (If that is even what you call it) . The cells are linked in the macro just side by side and not on top of each other.

Just looking for some help.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,993
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to MrExcel.
Try replacing some of the " " with vbLf
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
65,993
Office Version
  1. 365
Platform
  1. Windows
You're welcome & thanks for the feedback.
 

Forum statistics

Threads
1,148,242
Messages
5,745,588
Members
423,963
Latest member
lwilson3

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
Top