PC Review


Reply
Thread Tools Rate Thread

copy and pasting header information

 
 
ghamilton@labattfood.com
Guest
Posts: n/a
 
      9th Apr 2007
I use a separate workbook for my commonly used macros. I want to
store some default header labels also, but I cannot get it to "paste"
the value on cell "N10" in workbook "B" over to the left header on
workbook "A". Right now I use this macro to prompt me with dialog
boxes. The first and third input boxes are going to be the same for
all workbooks done in a month. Another option would be to populate
the dialog box with a value located in a certain cell on my macro
workbook.


Sub header()


Dim pos As Integer


With ActiveSheet.PageSetup
If .LeftHeader <> "" Then
pos = InStr(1, .LeftHeader, Chr(10))
If pos > 0 Then
Period = Left(.LeftHeader, pos - 1)
divname = Right(.LeftHeader, Len(.LeftHeader) - pos)
End If
End If


If .CenterHeader <> "" Then
pos = InStr(1, .CenterHeader, Chr(10))
If pos > 0 Then
title1 = Left(.CenterHeader, pos - 1)
title2 = Right(.CenterHeader, Len(.CenterHeader) - pos)
End If
End If
End With


Period = InputBox("What Period?", , Period)
divname = InputBox("What Division?", , divname)
title1 = InputBox("CENTER TITLE ROW 1", , title1)
title2 = InputBox("CENTER TITLE ROW 2", , title2)


With ActiveSheet.PageSetup
.LeftHeader = Period & Chr(10) & divname
.CenterHeader = title1 & Chr(10) & title2
.RightHeader = Date
.RightFooter = Page
End With


End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pasting removes header =?Utf-8?B?c2hlcA==?= Microsoft Word Document Management 1 29th Aug 2006 07:19 PM
Pasting into a Header and Footer document issue Christian Blackburn Microsoft Word Document Management 1 20th Apr 2006 09:56 PM
Pasting into Header/Footer =?Utf-8?B?V2VhdmU=?= Microsoft Excel New Users 1 3rd Dec 2005 04:29 PM
Deleting header rows when cut and pasting from another program TAT Microsoft Excel Misc 3 5th Jul 2004 04:58 PM
Re: problems pasting in customized header Debra Dalgleish Microsoft Excel Misc 0 16th Sep 2003 01:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:11 AM.