![]() |
Text Box Printing, and Footer Question
1st Question, I have a colored VBA textbox that is linked to a cell
Sorta used for a form so people know to input their name there. I wan to be able to print that without seeing the outline of the textbox o color shade. I tried object printing False but it won't print the inpu in the text box. maybe it needs some code? 2nd Question, when I have a header or a footer and want to link it to cell, how would I do that. For instance when they input their name i then Prints their name from that cell at the top or bottom of ever page. I looked in the custom header and footer but no go. Thanks fo your help -- Message posted from http://www.ExcelForum.com |
Text Box Printing, and Footer Question
Hi
For the second one you ma use the following code: Put it in your workbook moudle 8links cell A1 of each sheet to the footer): Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet For Each wkSht In Me.Worksheets With wkSht.PageSetup .CenterFooter = wkSht.Range("A1").value End With Next wkSht End Sub -- Regards Frank Kabel Frankfurt, Germany 1st Question, I have a colored VBA textbox that is linked to a cell. Sorta used for a form so people know to input their name there. I want to be able to print that without seeing the outline of the textbox or color shade. I tried object printing False but it won't print the input in the text box. maybe it needs some code? 2nd Question, when I have a header or a footer and want to link it to a cell, how would I do that. For instance when they input their name it then Prints their name from that cell at the top or bottom of every page. I looked in the custom header and footer but no go. Thanks for your help. --- Message posted from http://www.ExcelForum.com/ |
Text Box Printing, and Footer Question
Thanks Frank for the reply, I'm lost on where you want me to put th
code and the worksheet name is Data. I want to display Cell C11, C13, and C15 from Coversheet! on the Heade Right side on Data! sheet. And I want to display a disclaimer which i Cell A50 from Coversheet! on the Center Footer of Data! sheet. Thanks again for your help. BTW and good books I can buy that will hel me with code -- Message posted from http://www.ExcelForum.com |
Text Box Printing, and Footer Question
Hi
try the following - open the VBA editor (hit ALT+F11) - double click on 'ThisWorkbook' in the left explorer window - paste the code from below (adapted to your specification) - close the VBA editor ---- Private Sub Workbook_BeforePrint(Cancel As Boolean) Dim wkSht As Worksheet Dim source_wks as worksheet Dim heading_str as string set source_wks = me.worksheets("Coversheet") heading_str = source_wks.range("C11").value & " " & _ source_wks.range("C13").value & " " & _ source_wks.range("C15").value set wkSht = me.worksheets("Data") With wkSht.PageSetup .RightHeader = heading_str End With end Sub -- Regards Frank Kabel Frankfurt, Germany Thanks Frank for the reply, I'm lost on where you want me to put the code and the worksheet name is Data. I want to display Cell C11, C13, and C15 from Coversheet! on the Header Right side on Data! sheet. And I want to display a disclaimer which is Cell A50 from Coversheet! on the Center Footer of Data! sheet. Thanks again for your help. BTW and good books I can buy that will help me with code. --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 07:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com