View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Alternative VBA to copy a worksheet

This is an excerpt from VBA help on copying sheets.

If you don't specify either Before or After, Microsoft Excel creates a new
workbook that contains the copied sheet.

So it looks like you have to specify where you want it if you want it in the
same workbook. If you are having problems with that syntax, try using the
sheet name instead of the index number.

"Graham Whitehead" wrote:

Hi,

I am having some problems with some code I wrote a while back which has, up
unitl now, worked fine. The line is:

Sheets("Year to Date").Copy Befo=Sheets(1)

if there a generic way to copy a worksheet and move it to the first
posistion, i.e. the worksheet foremost to the left, without having to
specifiy Befo=Sheets(1) - as I am sure this is causing the problem.

Many thanks