Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default Macro Storage Location

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Macro Storage Location

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro help for changing data (cell location) in edit find box Jim Excel Discussion (Misc queries) 1 November 10th 06 10:57 PM
Using Macro to Save Copy of File to New Location Chris Z Excel Discussion (Misc queries) 3 September 12th 06 11:26 PM
From Macro in Excel find cursor location eg.C7 kt(uk) Excel Discussion (Misc queries) 1 May 10th 06 03:03 PM
Data Storage gregory.barrett Excel Discussion (Misc queries) 3 March 30th 06 10:23 PM
Macro in Excel 2002 to save a workbook to a FTP location Lloyd Excel Discussion (Misc queries) 0 December 21st 04 02:49 PM


All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"