Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WorkSheet ordering in Excel

Status
Not open for further replies.

tbg130

Programmer
Aug 11, 2004
46
CA
Hi All,

I'm new to alot of this stuff and I want to order the worksheets in Excel. I have written quite a bit of code that creates about 8 different worksheets, however, it seems to place sheet 8 at the beginning. I'd like to re-order the worksheets to have worksheet 1 as the leftmost tab.

Can anyone provide me with an idea or property or code that can help me accomplish this?

Thanks alot in advance for your time and efforts.

Tyler
 
This code will add a new Worksheet to the far left of your workbook sheets:

[tt]Dim ws As Worksheet
Set ws = Worksheets.Add(Worksheets(1))[/tt]

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
Thanks, but I'd like to re-order the 8 worksheets when the program has finished running... it is the last step and I want it to take the order from Table 8 to Table 1... and reverse it to Table 1 to Table 7...

Tyler
 
Ok. Easy enough!

[tt]
Private Sub MoveSheets()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Move , Worksheets(Worksheets.Count)
Next ws
End Sub

[/tt]

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top