Want tab copies to count up not down

jwindholz2725

Board Regular
Joined
Sep 20, 2011
Messages
94
I have a code here that will create copies of sheets and name them based off the values in cells A1:on. The issue is they count down 18,17,16,etc... How can I adjust the code so they count up. 16,17,18,etc...? In other words the first copy created goes on the end not the beginning of the copied tabs. I would like the tabs in the order going down from A1:on

Please help!!

Sub MakeTemplates()
Dim rMyCell As Range
For Each rMyCell In Sheets("WBS").Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
If Len(rMyCell.Value) Then
Sheets("Template").Copy After:=Sheets(1)
Sheets("Template (2)").Name = rMyCell.Value
End If
Next
End Sub
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Maybe something like this?

Code:
Sub MakeTemplates()
Dim rMyCell As Range
For Each rMyCell In Sheets("WBS").Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
If Len(rMyCell.Value) Then
Sheets("Template").Copy After:=[B][COLOR=red]Sheets(rMyCell.Row)
[/COLOR][/B]Sheets("Template (2)").Name = rMyCell.Value
End If
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top