Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default copy and pasting header information

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
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
Header Information Belin Excel Worksheet Functions 2 May 29th 10 07:36 PM
Pasting grouped information Aidan Excel Discussion (Misc queries) 2 May 19th 08 06:33 PM
CSV Header Information Help?[_2_] Excel Programming 11 November 6th 06 01:26 PM
Pasting Information from Multiple Cells Richard Excel Discussion (Misc queries) 1 October 17th 06 12:55 PM
Pasting into Header/Footer Weave New Users to Excel 1 December 3rd 05 04:29 PM


All times are GMT +1. The time now is 02:16 PM.

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

About Us

"It's about Microsoft Excel"