Is there a way to protect the Header or the Footer from deletion? (or changes) I don't neccessary want to protect the whole sheet.
Is there a way to protect the Header or the Footer from deletion? (or changes) I don't neccessary want to protect the whole sheet.
Most of the info I've found about this topic says it can't be done, but, you can use vba to set the headers/footers to whatever you want on the BeforePrint event.
From a post of DominicB in July 2005:
Place your headers / footers between the quotes above, empty quotes![]()
Please Login or Register to view this content.
will remove any header or footer that has been inserted. As the
procedure uses events it needs placing in the ThisWorkbook pane of the
VBE.
Thanks, Dom.
Hi Paul
Your welcome. And thanks for the credit. It's that long since I made that post I could have forgotten all about it.
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Thanks pjoaquin, I saw the same thing before my post but I have no idea what VBAis. I am not an expert on Excel. I was hoping something a bit easier to understand. Thanks anyway.
Hi tonyk,Originally Posted by tonyk
May be this link will help?
http://www.functionx.com/vbaexcel/index.htm
oldchippy
-------------
![]()
![]()
Blessed are those who can give without remembering and take without forgetting
If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.
Click here >>> Top Excel links for beginners to Experts
Forum Rules >>>Please don't forget to read these
Thank you oldchippy. This was definitely a more step by step.
oldchippy - I went into the link you provided but i didn't understand it. Where and what "Module"/window do I enter the code? Sorry for the late question. It took me 3 days trying to figure it out but with no success.
From your spreadsheet, go to Tools > Macros > Visual Basic Editor you will then see
http://www.functionx.com/vbaexcel/Lesson01.htm
Hi tonyk
OK. Open Excel with just the file you want to affect open - nothing else.
Press Alt + F11. This will open the VBE - Excel's prpogramming environment.
Look in the project window (usually top left) for the object called "ThisWorkbook".
Double click on it.
This should open up an empty pane to the right. There will be two dropdown boxes containing the words "General" and "Declarations".
Paste my code that Paul gave you into the empty pane.
Go to File > Close and Return to Microsoft Excel.
Save the file as normal.
Nothing will appear to happen unitl you print, when the print call will be intercepted by your macro and the macro will execute before being printed - in this instance reinstating the header / footer.
HTH
DominicB
Thank you for the explanation. I did everything but print. I didn't know it wouldn't show under Header and Footer. I wracked my brain out for three days. I might missed that part on my print out. Thanks oldchippy, and dominicb. Great help!
dominicb, oldchippy, pjoaquin and helpful others. Since I can't go into header or footer to view, how do edit the entries? I need to change the fonts? Format doesn't have the Font increase in the VBE window. Is there another code for that too?
DominicB, excelent you post. Work fine.
What i have do if i want to insert a image into de headers / footers ?
Thanks in advance
SGA
After using the code to protect the footer, how can we enter page number. Is their any code for it?
Thanks in advance
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks