Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Insert worksheet at end


Hi,

I am trying to insert a blank worksheet using the code:

Sheets.add

The problem is that the new worksheet inserts itself to the left of the
active sheet. I would like it to appear at the end of the sheets e.g.
Sheet 1, Sheet 2, Sheet 3, new sheet.

Any help would be appreciated.

Thanks


--
JamesArchibald
------------------------------------------------------------------------
JamesArchibald's Profile: http://www.excelforum.com/member.php...o&userid=33284
View this thread: http://www.excelforum.com/showthread...hreadid=565087

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Insert worksheet at end

One of the joyful quirks of Excel. You could do it with VBA, but just as
easy to drag it over.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JamesArchibald"
<JamesArchibald.2bju1q_1153911305.6918@excelforu m-nospam.com wrote in
message news:JamesArchibald.2bju1q_1153911305.6918@excelfo rum-nospam.com...

Hi,

I am trying to insert a blank worksheet using the code:

Sheets.add

The problem is that the new worksheet inserts itself to the left of the
active sheet. I would like it to appear at the end of the sheets e.g.
Sheet 1, Sheet 2, Sheet 3, new sheet.

Any help would be appreciated.

Thanks


--
JamesArchibald
------------------------------------------------------------------------
JamesArchibald's Profile:

http://www.excelforum.com/member.php...o&userid=33284
View this thread: http://www.excelforum.com/showthread...hreadid=565087



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Insert worksheet at end

James,
Look at the 2nd argument to .Add.
e.g.
With ThisWorkbook
.Sheets.Add , .Worksheets(.Worksheets.Count)
End With

NickHK

"JamesArchibald"
<JamesArchibald.2bju1q_1153911305.6918@excelforu m-nospam.com wrote in
message news:JamesArchibald.2bju1q_1153911305.6918@excelfo rum-nospam.com...

Hi,

I am trying to insert a blank worksheet using the code:

Sheets.add

The problem is that the new worksheet inserts itself to the left of the
active sheet. I would like it to appear at the end of the sheets e.g.
Sheet 1, Sheet 2, Sheet 3, new sheet.

Any help would be appreciated.

Thanks


--
JamesArchibald
------------------------------------------------------------------------
JamesArchibald's Profile:

http://www.excelforum.com/member.php...o&userid=33284
View this thread: http://www.excelforum.com/showthread...hreadid=565087



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Insert worksheet at end

Hello,

This will do it:

Sub addSheet()
Sheets.Add after:=Worksheets(Worksheets.Count)
End Sub

ChasAA

"JamesArchibald" wrote:


Hi,

I am trying to insert a blank worksheet using the code:

Sheets.add

The problem is that the new worksheet inserts itself to the left of the
active sheet. I would like it to appear at the end of the sheets e.g.
Sheet 1, Sheet 2, Sheet 3, new sheet.

Any help would be appreciated.

Thanks


--
JamesArchibald
------------------------------------------------------------------------
JamesArchibald's Profile: http://www.excelforum.com/member.php...o&userid=33284
View this thread: http://www.excelforum.com/showthread...hreadid=565087


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 lukerush Excel Worksheet Functions 2 September 7th 06 05:05 PM
Wish to add a WORKSHEET but 'WORKSHEET' not open in 'INSERT' Zona Excel Worksheet Functions 1 September 6th 06 03:52 AM
Why can't I insert a row in my worksheet? susanholland3 New Users to Excel 9 August 11th 06 03:32 AM
Can I auto insert a worksheet when I insert a value in a cell. iainc Excel Worksheet Functions 0 April 27th 06 08:37 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"