ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Header (https://www.excelbanter.com/excel-programming/338078-custom-header.html)

Richard

Custom Header
 
Using Excel 2000.
1) I cut and paste data into an Excel spreadsheet.
2) There is a value in Cell D1.
3) I want to run a Macro, which will rearrange all the data in this
spreadsheet.
4) I know how to do all of it except:
I want the value in cell D1 to be placed in the custom header, right
side.
How can this be done?

Thanks.
--
Richard

Jim Thomlinson[_4_]

Custom Header
 
Sub AddToHeader()
With Sheets("Sheet1")
.PageSetup.RightHeader = .Range("D1").Value
End With
End Sub
--
HTH...

Jim Thomlinson


"Richard" wrote:

Using Excel 2000.
1) I cut and paste data into an Excel spreadsheet.
2) There is a value in Cell D1.
3) I want to run a Macro, which will rearrange all the data in this
spreadsheet.
4) I know how to do all of it except:
I want the value in cell D1 to be placed in the custom header, right
side.
How can this be done?

Thanks.
--
Richard


Richard

Custom Header
 
Thank you very much. Works 100%.
--
Richard


"Jim Thomlinson" wrote:

Sub AddToHeader()
With Sheets("Sheet1")
.PageSetup.RightHeader = .Range("D1").Value
End With
End Sub
--
HTH...

Jim Thomlinson


"Richard" wrote:

Using Excel 2000.
1) I cut and paste data into an Excel spreadsheet.
2) There is a value in Cell D1.
3) I want to run a Macro, which will rearrange all the data in this
spreadsheet.
4) I know how to do all of it except:
I want the value in cell D1 to be placed in the custom header, right
side.
How can this be done?

Thanks.
--
Richard


ts1

Custom Header
 
Jim,

I am still new to macro programming and tried using your suggestion in the
Workbook_open event with no luck. Can you please provide a some additional
guidance in the following scenario.

I have a workbook with 3 worksheets. There is a value in cell B2 of Sheet1
that I want the custom header of all three worksheets to have. Any help would
be much appreciated.

Thanks,
Tom S

"Jim Thomlinson" wrote:

Sub AddToHeader()
With Sheets("Sheet1")
.PageSetup.RightHeader = .Range("D1").Value
End With
End Sub
--
HTH...

Jim Thomlinson


"Richard" wrote:

Using Excel 2000.
1) I cut and paste data into an Excel spreadsheet.
2) There is a value in Cell D1.
3) I want to run a Macro, which will rearrange all the data in this
spreadsheet.
4) I know how to do all of it except:
I want the value in cell D1 to be placed in the custom header, right
side.
How can this be done?

Thanks.
--
Richard


Rowan Drummond[_3_]

Custom Header
 
This worked for me:

Private Sub Workbook_Open()
Dim i As Integer
For i = 1 To 3
With Sheets(i)
.PageSetup.RightHeader = Sheets("Sheet1").Range("B2").Value
End With
Next i
End Sub

Hope this helps
Rowan

ts1 wrote:
Jim,

I am still new to macro programming and tried using your suggestion in the
Workbook_open event with no luck. Can you please provide a some additional
guidance in the following scenario.

I have a workbook with 3 worksheets. There is a value in cell B2 of Sheet1
that I want the custom header of all three worksheets to have. Any help would
be much appreciated.

Thanks,
Tom S

"Jim Thomlinson" wrote:


Sub AddToHeader()
With Sheets("Sheet1")
.PageSetup.RightHeader = .Range("D1").Value
End With
End Sub
--
HTH...

Jim Thomlinson



All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com