Selecting previous worksheet

C

Carolyne

I'm trying to create a macro to add a new worksheet and select the
previous worksheet to copy it. I can only select by specific name i
just want whichever sheet is previous. Can anyone help.
This is what i have so far

Application.ScreenUpdating = False
d$ = Format(Now, "dd.mm.yy")
Sheets.Add
Sheets("sheet1").Select
Sheets("Sheet1").Name = d$

The line below is where the problem is.

Sheets("12.05.04").Select
Cells.Select
Selection.Copy
 
S

SunTzuComm

Carolyne,

I think "ActiveSheet.Previous.Select" should work. This simulates pressing
Ctrl+PageUp.

Regards,
Wes
 
S

SunTzuComm

Carolyne,

On second thought, "ActiveSheet.Next.Select" is probably the one to use, since
Excel adds a new worksheet in front of the currently active one.

Regards,
Wes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top