LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Peter
 
Posts: n/a
Default Arrays, & Worksheets & Grey Hair

Hello All..

I am trying to get this thing to function..without much success.

What it needs to do is..

Only insert one new sheet on request (called from another macro/userform)

Check if that sheet already exists, then insert the next one from the array
where the sheet names are stored.

Here's the code so far..(It just spits out all the sheets in the array in
one go)


Sub Newsheets()

Dim nLast As Long
Dim i As Long
Dim NewSheet
Dim n As Long
Dim a As Long

NewSheet = Array("31-60", "61-90", "91-120", "121-150")

For n = LBound(NewSheet) To UBound(NewSheet)
nLast = Sheets.Count
For i = 1 To ActiveWindow.SelectedSheets.Count


Sheets.Add _
After:=Sheets(Sheets.Count), _
Type:= _
"C:\Documents and Settings\Admin\Application
Data\Microsoft\Templates\New Sheet.XLT"
Sheets("sheet1").Name = NewSheet(n)
Count = 1

Sheets(nLast + 1).Select

Next i
Add_Numbers
Next n


End Sub

Any thoughts on where to go from here are indeed welcomed.

Regards
Peter




 
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
indirect function in different worksheets, losing my hair! Alexander Banz Excel Discussion (Misc queries) 2 February 16th 05 03:59 PM
How to protect and unprotect 30 worksheets in a file every month . Protect & Unprotect Several Worksheets Excel Worksheet Functions 4 January 10th 05 01:29 PM
Protect/unprotect all worksheets Janna Excel Worksheet Functions 2 January 7th 05 01:01 AM
HELP! How do you--> Lock a set of rows but also link worksheets to FRUSTRATED Excel Discussion (Misc queries) 6 December 29th 04 10:05 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM


All times are GMT +1. The time now is 12:49 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"