ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy before hidden sheet (https://www.excelbanter.com/excel-programming/296279-copy-before-hidden-sheet.html)

Steve

Copy before hidden sheet
 
I am trying to insert a copied sheet before a hidden sheet, as it is now the
copy goes after the hidden sheet. Is there a modification to .copy before
to accomplish this or is unhide, copy, then re-hide the way to do it?

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
.Copy Befo=Worksheets("Sheet2")
Sheets("Sheet2").Visible = True

Thanks



Bob Phillips[_6_]

Copy before hidden sheet
 
Steve,

You had 2 replies to this on 23rd. Did neither suit, and if not, what was
the problem?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steve" <sailor4life61@hotmaildotcom wrote in message
...
I am trying to insert a copied sheet before a hidden sheet, as it is now

the
copy goes after the hidden sheet. Is there a modification to .copy before
to accomplish this or is unhide, copy, then re-hide the way to do it?

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
.Copy Befo=Worksheets("Sheet2")
Sheets("Sheet2").Visible = True

Thanks





Steve

Copy before hidden sheet
 
I have gone back and connot see any replies. Sorry

"Bob Phillips" wrote in message
...
Steve,

You had 2 replies to this on 23rd. Did neither suit, and if not, what was
the problem?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steve" <sailor4life61@hotmaildotcom wrote in message
...
I am trying to insert a copied sheet before a hidden sheet, as it is now

the
copy goes after the hidden sheet. Is there a modification to .copy

before
to accomplish this or is unhide, copy, then re-hide the way to do it?

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
.Copy Befo=Worksheets("Sheet2")
Sheets("Sheet2").Visible = True

Thanks







Tom Ogilvy

Copy before hidden sheet
 
Try making it visible before and hide it after

Worksheets("Data") .Visible = xlSheetVisible
....

Worksheets("Data") .Visible = xlSheetHidden

--

HTH

Bob Phillips
=========================
Try this

Application.ScreenUpdating = False
x = Worksheets("Data").Visible
If x < True Then Worksheets("Data").Visible = True
....Copy Befo=Worksheets("Data") where DATA! is hidden
If x < True Then Worksheets("Data") = xlVeryHidden
Application.ScreenUpdating = True

Chris

========================

Hi Steve,

Steve schrieb:
What modification must be made to copy before when the sheet is hidden.
Example
.Copy Befo=Worksheets("Data") where DATA! is hidden. The copy ends up
after DATA rather than before.


Try this:

Worksheets("Sheet1").Copy After:=Worksheets("Data")
Worksheets("Data").Move After:=ActiveSheet

--
Regards

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

--
Regards,
Tom Ogilvy

"Steve" <sailor4life61@hotmaildotcom wrote in message
...
I have gone back and connot see any replies. Sorry

"Bob Phillips" wrote in message
...
Steve,

You had 2 replies to this on 23rd. Did neither suit, and if not, what

was
the problem?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steve" <sailor4life61@hotmaildotcom wrote in message
...
I am trying to insert a copied sheet before a hidden sheet, as it is

now
the
copy goes after the hidden sheet. Is there a modification to .copy

before
to accomplish this or is unhide, copy, then re-hide the way to do it?

Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
.Copy Befo=Worksheets("Sheet2")
Sheets("Sheet2").Visible = True

Thanks










All times are GMT +1. The time now is 12:36 AM.

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