Calgarypuck Forums - The Unofficial Calgary Flames Fan Community

Go Back   Calgarypuck Forums - The Unofficial Calgary Flames Fan Community > Main Forums > The Off Topic Forum > Tech Talk
Register Forum Rules FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 11-27-2008, 03:08 PM   #1
Bring_Back_Shantz
Franchise Player
 
Bring_Back_Shantz's Avatar
 
Join Date: Jul 2003
Location: In my office, at the Ministry of Awesome!
Exp:
Default Excel Macro Help

Hey everyone.
Usually I'm pretty handy with Excel, but I'm having some major difficulty.

Basically I have to creat a bunch of copies of a worksheet in the same workbook and I'd like to name each worksheet from a list of names (I have to do a bunch of checklists for a bunch of wells and I don't want to have to create and name each sheet individually as there are a LOT of them).

I'm trying to use a macro to do this, but if there is a way to do it without a macro that'd be cool to.

Hope someone can help.
Thanks
__________________
THE SHANTZ WILL RISE AGAIN.
<-----Check the Badge bitches. You want some Awesome, you come to me!
Bring_Back_Shantz is offline   Reply With Quote
Old 11-28-2008, 09:52 AM   #2
HalifaxDrunk
#2 960 Prankster
 
HalifaxDrunk's Avatar
 
Join Date: Dec 2003
Location: In a Pub
Exp:
Default

Not sure if you pasting your list into this would be time consuming but try this:

Sub AddEm()

Dim aryNames As Variant
Dim lngOffset As Long
Dim lngLoop As Long

aryNames = Array("A02", "A08", "A11", "A13", "A14", "A15", "A21", "A22", "A28", "A28P", "A33", "NA")

lngOffset = 2 - LBound(aryNames)

Sheets.Add Count:=13 - Sheets.Count, after:=Sheets(Sheets.Count)

For lngLoop = LBound(aryNames) To UBound(aryNames)
Sheets(lngLoop + lngOffset). Name = aryNames(lngLoop)
Next

End Sub

Last edited by HalifaxDrunk; 11-28-2008 at 10:01 AM.
HalifaxDrunk is offline   Reply With Quote
Old 11-28-2008, 09:57 AM   #3
Bring_Back_Shantz
Franchise Player
 
Bring_Back_Shantz's Avatar
 
Join Date: Jul 2003
Location: In my office, at the Ministry of Awesome!
Exp:
Default

Thanks Halifax, but I managed to work it all out.
in a much more automated and elegant way.
__________________
THE SHANTZ WILL RISE AGAIN.
<-----Check the Badge bitches. You want some Awesome, you come to me!
Bring_Back_Shantz is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 01:15 PM.

Calgary Flames
2024-25




Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright Calgarypuck 2021 | See Our Privacy Policy