View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron de Bruin
 
Posts: n/a
Default Selecting Last Sheet

Hi

Don't know if I understand you correct but this will add a sheet and name it as the cell E1 in "Sheet1"

Worksheets.Add after:=Worksheets(Worksheets.Count)
ActiveSheet.Name = "M-" & Format(Sheets("Sheet1").Range("E1").Value, "dd.mm.yy")


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Bonbon" wrote in message ...
Hi again Ron,
Thank you so much, you code was alot of help to me =D
all i did was just entered it 5 times to add 5 sheets lol.

However theres another problem i came across. Copying the E1 cell and
pasting it as the name of the sheet. Is there a code for this? because when i
record it as a macro, it keeps on copying the actual name of the cell. e.g.
sheet 1, E1 = M-13.06.05, so on the next week (M-20.06.05) it continues to
copy the last M-13.06.05.
I checked on the macro, and it says copy M-13.06.05, i want it to copy the
things inside the cell E1.

Pls help
Thx in advance,
Bonbon

"Ron de Bruin" wrote:

Hi Bonbon

Because i created a macro which inserts more sheets after the Last

You used code you say that's why I posted code

This line will add a worksheet at the end
Worksheets.Add after:=Worksheets(Worksheets.Count)

And this will select the last worksheet
Worksheets(Worksheets.Count).Select

Have you try this?


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Bonbon" wrote in message ...
Sorry im like a beginner to Excel, and i dont understand what you mean, could
you sort of make it clearer what you wanted me to do? thanks

Bonbon

"Ron de Bruin" wrote:

Hi Bonbon

You can use this if you have only worksheets in your workbook

Worksheets.Add after:=Worksheets(Worksheets.Count)

To select
Worksheets(Worksheets.Count).Select


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Bonbon" wrote in message ...
Is there any way to select the last Worksheet, other than clicking on the
Last Tab?
Because i created a macro which inserts more sheets after the Last Sheet,
but that Last Sheet is named (lets call it LS), so everytime the macro runs
it inserts new sheets after the LS sheet, rather than the 'real' last sheets.

Please help, i've been trying and trying =(
Thx in advance

Bonbon