Copy Sheet

S

Steve

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

Thanks
 
B

Bob Phillips

Try making it visible before and hide it after

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

Worksheets("Data") .Visible = xlSheetHidden

--

HTH

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

Melanie Breden

Hi Steve,
What modification must be made to copy before when the sheet is hidden.
Example
.Copy Before:=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)
 
Top