Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Greegan
 
Posts: n/a
Default Copy worksheet question

How would I have the Header copied over when I copy the worksheet I've
selected - but in a macro?

I have it now so I click a menu button that's linked to the macro which
copies the worksheet and has very few issues showing up, except the header
is not copying over.

I understand this is how its supposed to happen, but outside of recording a
macro where I'm copying info from one sheet's Header to the other I don't
know what else I can do. Can anyone assist me with this?

Thanks in advance

G


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

If your macro does the same thing as edit|Move or copy sheet, then you should be
seeing the headers, too.

But it sounds like you're copying some of the cells--not all. Maybe you can
amend the macro to include those header rows???

You may want to post that portion of the code that does the copying.

Greegan wrote:

How would I have the Header copied over when I copy the worksheet I've
selected - but in a macro?

I have it now so I click a menu button that's linked to the macro which
copies the worksheet and has very few issues showing up, except the header
is not copying over.

I understand this is how its supposed to happen, but outside of recording a
macro where I'm copying info from one sheet's Header to the other I don't
know what else I can do. Can anyone assist me with this?

Thanks in advance

G


--

Dave Peterson
  #3   Report Post  
Greegan
 
Posts: n/a
Default

All i did for this is record an RIGHT CLICK on the tab"Insert Template DO
NOT DELETEmove/copycreate copy, and then i named the tab TEMP
and I believe I zoomed the size to 80 % but that's about it

any help is appreciated

Here it is...

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/29/2005 by sbeattie
'

'
Dim nSht As Worksheet
Set nSht = Sheets.Add
nSht.Move befo=Sheets(Sheets.Count)
ActiveSheet.Name = "Temp"
Range("A1").Select
' test passed
Application.CutCopyMode = False
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = False
End With
Range("A1").Select
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.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
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 80
.PrintErrors = xlPrintErrorsDisplayed
End With
Sheets("Insert Template DO NOT DELETE").Select
Cells.Select
Selection.Copy
Sheets("Temp").Select
Cells.Select
ActiveSheet.Paste
Range("A1:H2").Select
End Sub



"Dave Peterson" wrote in message
...
If your macro does the same thing as edit|Move or copy sheet, then you
should be
seeing the headers, too.

But it sounds like you're copying some of the cells--not all. Maybe you
can
amend the macro to include those header rows???

You may want to post that portion of the code that does the copying.

Greegan wrote:

How would I have the Header copied over when I copy the worksheet I've
selected - but in a macro?

I have it now so I click a menu button that's linked to the macro which
copies the worksheet and has very few issues showing up, except the
header
is not copying over.

I understand this is how its supposed to happen, but outside of recording
a
macro where I'm copying info from one sheet's Header to the other I don't
know what else I can do. Can anyone assist me with this?

Thanks in advance

G


--

Dave Peterson



  #4   Report Post  
Norman Jones
 
Posts: n/a
Default

Hi Greegan,

Try replacing your code with:

Sub InsertSheet()

Sheets("Insert Template DO NOT DELETE").Copy _
After:=Sheets(Sheets.Count)
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = True
.Zoom = 80
End With

ActiveSheet.Name = "Temp"

End Sub

---
Regards,
Norman



"Greegan" wrote in message
...
All i did for this is record an RIGHT CLICK on the tab"Insert Template DO
NOT DELETEmove/copycreate copy, and then i named the tab TEMP
and I believe I zoomed the size to 80 % but that's about it

any help is appreciated

Here it is...

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/29/2005 by sbeattie
'

'
Dim nSht As Worksheet
Set nSht = Sheets.Add
nSht.Move befo=Sheets(Sheets.Count)
ActiveSheet.Name = "Temp"
Range("A1").Select
' test passed
Application.CutCopyMode = False
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = False
End With
Range("A1").Select
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.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
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 80
.PrintErrors = xlPrintErrorsDisplayed
End With
Sheets("Insert Template DO NOT DELETE").Select
Cells.Select
Selection.Copy
Sheets("Temp").Select
Cells.Select
ActiveSheet.Paste
Range("A1:H2").Select
End Sub



"Dave Peterson" wrote in message
...
If your macro does the same thing as edit|Move or copy sheet, then you
should be
seeing the headers, too.

But it sounds like you're copying some of the cells--not all. Maybe you
can
amend the macro to include those header rows???

You may want to post that portion of the code that does the copying.

Greegan wrote:

How would I have the Header copied over when I copy the worksheet I've
selected - but in a macro?

I have it now so I click a menu button that's linked to the macro which
copies the worksheet and has very few issues showing up, except the
header
is not copying over.

I understand this is how its supposed to happen, but outside of
recording a
macro where I'm copying info from one sheet's Header to the other I
don't
know what else I can do. Can anyone assist me with this?

Thanks in advance

G


--

Dave Peterson





  #5   Report Post  
Greegan
 
Posts: n/a
Default

That's awesome man! thanks a lot.
"Norman Jones" wrote in message
...
Hi Greegan,

Try replacing your code with:

Sub InsertSheet()

Sheets("Insert Template DO NOT DELETE").Copy _
After:=Sheets(Sheets.Count)
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = True
.Zoom = 80
End With

ActiveSheet.Name = "Temp"

End Sub

---
Regards,
Norman



"Greegan" wrote in message
...
All i did for this is record an RIGHT CLICK on the tab"Insert Template DO
NOT DELETEmove/copycreate copy, and then i named the tab TEMP
and I believe I zoomed the size to 80 % but that's about it

any help is appreciated

Here it is...

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 7/29/2005 by sbeattie
'

'
Dim nSht As Worksheet
Set nSht = Sheets.Add
nSht.Move befo=Sheets(Sheets.Count)
ActiveSheet.Name = "Temp"
Range("A1").Select
' test passed
Application.CutCopyMode = False
With ActiveWindow
.DisplayGridlines = False
.DisplayHeadings = False
End With
Range("A1").Select
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.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
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 80
.PrintErrors = xlPrintErrorsDisplayed
End With
Sheets("Insert Template DO NOT DELETE").Select
Cells.Select
Selection.Copy
Sheets("Temp").Select
Cells.Select
ActiveSheet.Paste
Range("A1:H2").Select
End Sub



"Dave Peterson" wrote in message
...
If your macro does the same thing as edit|Move or copy sheet, then you
should be
seeing the headers, too.

But it sounds like you're copying some of the cells--not all. Maybe you
can
amend the macro to include those header rows???

You may want to post that portion of the code that does the copying.

Greegan wrote:

How would I have the Header copied over when I copy the worksheet I've
selected - but in a macro?

I have it now so I click a menu button that's linked to the macro which
copies the worksheet and has very few issues showing up, except the
header
is not copying over.

I understand this is how its supposed to happen, but outside of
recording a
macro where I'm copying info from one sheet's Header to the other I
don't
know what else I can do. Can anyone assist me with this?

Thanks in advance

G

--

Dave Peterson







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
worksheet question Anthony Excel Discussion (Misc queries) 2 July 8th 05 10:10 PM
how do i copy the format of a cell from one worksheet to another Edith F Excel Discussion (Misc queries) 5 June 16th 05 09:17 PM
Change position of move or copy worksheet option in Excel JesseAviles Excel Discussion (Misc queries) 1 February 22nd 05 10:25 PM
copy worksheet (keeping formats) Ken New Users to Excel 3 February 16th 05 04:37 PM
How do I copy a cell (content AND format) from one worksheet to a. Excel Format Copy Excel Worksheet Functions 1 February 9th 05 10:34 PM


All times are GMT +1. The time now is 12:48 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"