Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default please help me with my looping of copy worksheets


hi I have the following code


Code:
--------------------
Sub Config()
' Setup workbook for area to use
' noStores = the number of stores in an area
' Temp Sheet = Template for Stores Data
' Menu Sheet = Main Sheet for Areas to complete

Dim noStores As Integer

noStores = Range("noStores").Value

' Show Stores to enter in their names
Rows("12:33").EntireRow.Hidden = False
For Each cell In Sheets("menu").Range("A13:A32")
If cell.Value noStores Then
cell.EntireRow.Hidden = True
End If
Next


' Copy the correct amount of worksheets per store.

' Sheets("temp").Visible = True
For i = 1 To noStores
Sheets("Temp").Copy After:=Sheets(Sheets.Count)
Sheets("Temp (2)").Name = "Store " & i
Range("f3").Value = "=store_" & i
Next
' Sheets("temp").Visible = False

' Sheets("Menu").Range("a1").Activate



End Sub

--------------------


I have a problem when I am copying the template sheet I refer to the
line "Sheets("Temp").Copy After:=Sheets(Sheets.Count)" it copys the
sheet however it seems to break the loop and end the sub for no
apparent reason.

Any ideas where i might be going wrong?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=553256

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
Looping through Worksheets Steve Excel Programming 7 July 12th 05 07:56 PM
Looping worksheets in workbook Wylie C Excel Programming 2 March 18th 05 08:04 PM
Looping through Worksheets Kirk P. Excel Programming 1 February 7th 05 05:14 PM
looping through worksheets Alex ekster Excel Programming 1 July 21st 03 03:16 AM
looping through worksheets alex Excel Programming 0 July 20th 03 06:43 PM


All times are GMT +1. The time now is 05:20 PM.

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"