VBA issue of Excel bug?

marshak

Board Regular
Joined
May 28, 2007
Messages
65
Hi all!

I need your help and expertise once again.

The macro in this worksheet links cell B2 to the footer. So when you type into cell B2, it updates the Footer (and places whatever text you just typed into cell B2 into the left Footer location).

Problem is, when I type into B2 and press enter, the view changes - - the contents of page one extends to another page (page one only showing columns A through F, instead of A through H).

And the only way to make it appear normal is to go into print preview then back to sheet.

Not sure if this has any bearing, but I am viewing in Page Layout view, with a custom zoom of 100%

Thanks so much in advance for any insight!

Macro used:

Sub AddFooterToAll()
'Update 20140318
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection.Range("A1")
Set WorkRng = Application.InputBox("Range (single cell)", xTitleId, WorkRng.Address, Type:=8)
For Each ws In Application.ActiveWorkbook.Worksheets
ws.PageSetup.LeftFooter = WorkRng.Range("A1").Value
Next
End Sub


This question also posted under the following link:
https://www.excelforum.com/excel-fo...er-macro-is-run-page-layout-view-changes.html
 
Last edited:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

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