Beforeprint MACRO practice reply.

July 22, 2016 at 03:57:41
Specs: Windows 7
Hi all,

I was following with interest the help given by DerbyDad03 on as I too want the same thing as Brian W.

In my case, the sheet is named ''Enterprize Size Determination'' so after I understood the general concept before Beforeprint Macro, I tried the following code (without actually understanding the syntax referred to)

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim rFormulaCell As Range
Set rFormulaCell = Sheets("Enterprize size determination").[A1]
ActiveSheet.PageSetup.CenterHeader = rFormulaCell
End Sub

I tried pasting it both on:

Prjoject VBA Project
Sheet 4 (Enterprize size determination)

But it is not doing any thing as no header is printing or showing in print preview.


Alan Effe.

message edited by AlanEffe1983

See More: Beforeprint MACRO practice reply.

Reply ↓  Report •

July 27, 2016 at 05:57:38
It works fine for me, You need to have a value in sheet "Enterprize size determination" range A1.

Then paste the code into 'ThisWorkbook'

When you print preview any other sheet, you will see the heading change to whatever you had set in A1 of Enterprize Size determination sheet.

Reply ↓  Report •

July 27, 2016 at 09:32:25
FWIW, I had to actually print out the sheet before the Print Preview screen would show the header.

Once I physically printed the sheet, all sheets showed the A1 value as the header in Print Preview.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

message edited by DerbyDad03

Reply ↓  Report •

August 30, 2016 at 00:51:27
Hi all, thanks for all your help. The issue remained unresolved as my Excel was not resonding to this Macro.

I decided to give it a rest and remain without it.

Nothing to do. But thanks anyway.

Alan Effe

Reply ↓  Report •

Related Solutions

Ask Question