Running a Macro on Startup

Nomas

Board Regular
Joined
Jun 14, 2011
Messages
91
Hi,

I have the following macros that I basically want to run upon opening a file and to copy an existing sheet and renaming it. If I run the duplicate macro it works fine, just doesnt work at startup.

Private Sub Workbook_Open()

Call Duplicate_Item_List

MsgBox "Item List Duplicated", vbInformation, "Item Tool"

End Sub


Sub Duplicate_Item_List()
'
' Duplicate_Item_List Macro
'
'
Sheets("Item List").Select
Sheets("Item List").Copy Before:=Sheets(7)
Sheets("Item List (2)").Select
Sheets("Item List (2)").Name = "Item List Checksheet"
Range("A1").Select
Sheets("Item List").Select
Range("A1").Select
End Sub

I'm not sure where to go. I appreciate any help in advance :)
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Welcome to the Board!

Where did you put the Open event code? It should be in the ThisWorkbook module.
 
Upvote 0
Thanks, Im new to macros but quickly liking them. It is created in Module 2. Not sure how to get it to ThisWorkbook or what that is :confused:
 
Upvote 0
To get to ThisWorkbook

1. Hit Alt+F11
2. Expand VBAProject (Book1) or whatever the name of your workbooks is.
3. Double click on ThisWorkbook under "Microsoft Excel Objects"
4. Copy the text into the right side of the screen
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,628
Members
452,933
Latest member
patv

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