Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Worksheets - Add / Move between

I have a workbook with 3 sheets and data on the first
sheet only.

I want to add a sheet (4) after sheet (3). Then copy data
from sheet (1) onto sheet (4).

I then want to add a sheet (5) after sheet (4) and copy
different data from sheet (1) onto sheet (5).

I then want to add sheet (6) after sheet (5) and copy a
third set of data from sheet 1 to sheet (6).

I need to continue adding sheets after the last sheet
added until I have no more data to copy.

I'm having trouble (1) identifying the last sheet to add a
new sheet after and (2) moving back to sheet (1).

Any help you could provide in adding sheets without
speicifying a sheet name and moving between the sheets
without specifying sheet names would be greatly
appreciated. I'm sure you can do this with a variable or
array but I'm not having much luck today. Thanks again
for the help....Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Worksheets - Add / Move between


This code should do what you want:

' Find how many sheets are in the workbook
Dim No_Sheets
No_Sheets = Sheets.Count

' Add a new sheet
Sheets.Add

' The new sheet is the active sheet. Move it to after the
last sheet
ActiveSheet.Move After:=Sheets(No_Sheets + 1)

HTH
Helen





-----Original Message-----
I have a workbook with 3 sheets and data on the first
sheet only.

I want to add a sheet (4) after sheet (3). Then copy

data
from sheet (1) onto sheet (4).

I then want to add a sheet (5) after sheet (4) and copy
different data from sheet (1) onto sheet (5).

I then want to add sheet (6) after sheet (5) and copy a
third set of data from sheet 1 to sheet (6).

I need to continue adding sheets after the last sheet
added until I have no more data to copy.

I'm having trouble (1) identifying the last sheet to add

a
new sheet after and (2) moving back to sheet (1).

Any help you could provide in adding sheets without
speicifying a sheet name and moving between the sheets
without specifying sheet names would be greatly
appreciated. I'm sure you can do this with a variable or
array but I'm not having much luck today. Thanks again
for the help....Mike

.

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
move between worksheets using the keyboard R Oconnor Excel Worksheet Functions 4 October 5th 06 06:06 PM
Can't move between worksheets DIANE K Excel Worksheet Functions 2 March 1st 06 02:01 PM
Move between worksheets SM Excel Worksheet Functions 3 October 26th 05 09:10 AM
How do I move information between worksheets? Nocomputergeek Excel Worksheet Functions 2 October 10th 05 03:02 PM
Worksheets - Add / Move between Mike Excel Programming 1 January 21st 04 11:45 PM


All times are GMT +1. The time now is 08:44 PM.

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

About Us

"It's about Microsoft Excel"