Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
OS: MS XP
Excel: 2002 I have a macro which I use to update the page Settings in an Excel file. What I dont know how to do is: 1) Have the macro read the value at the start of its execution from cell B1. 2) Store the value found in cell B1. 3) At the end of the macro execution write the value from B1 to the Custom Header section in the page setup. Left Section:. Thanks in advanced. -- Richard |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi.
1.use a variable. dim stg as sting 2. store the string in B1 stg - range("B1").value 3 set the left header. (i did this part on record so you can see the whole thing. I never could remember them all.) With ActiveSheet.PageSetup .LeftHeader = stg .CenterHeader = "" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = False .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed End With basicly, declare the variable, assign it a value, use the varible to set the left header or any other header or footer. hope this helped. regards FSt1 "Richard" wrote: OS: MS XP Excel: 2002 I have a macro which I use to update the page Settings in an Excel file. What I dont know how to do is: 1) Have the macro read the value at the start of its execution from cell B1. 2) Store the value found in cell B1. 3) At the end of the macro execution write the value from B1 to the Custom Header section in the page setup. Left Section:. Thanks in advanced. -- Richard |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro help for changing data (cell location) in edit find box | Excel Discussion (Misc queries) | |||
Using Macro to Save Copy of File to New Location | Excel Discussion (Misc queries) | |||
From Macro in Excel find cursor location eg.C7 | Excel Discussion (Misc queries) | |||
Data Storage | Excel Discussion (Misc queries) | |||
Macro in Excel 2002 to save a workbook to a FTP location | Excel Discussion (Misc queries) |