Combine Workbook open events

VonFeed

New Member
Joined
Dec 12, 2011
Messages
11
Hello, I figured out my last post to make a drop down list default to a certain choice when opening up excel. However I could not edit my post to state so and then ask my follow up question that I have to now to complete my workbook for users. My question is as follows:

How can I cobble together the following codes for workbook_open? What I would like is for a customer/user to open the workbook, 1) see the pop up & then x the pop up, then once the pop up is closed, 2) the workbook takes them to Sheet 2, 3) then the last routine to run resets a drop down list to a default value (can this item also be made to effect multiple sheets that have the drop down list in the same location on those sheets?). Here is my code so far:


Private Sub Workbook_Open()
MsgBox "Hello"
End Sub


Private Sub Workbook_Open()
Worksheets("Sheet2").Activate
End Sub


Private Sub Workbook_Open()
Sheets("Sheet2").Range("V6").Value = Sheets("Sheet1").Range("D5") ..... (((( can this item do this? (Sheets("Sheet2:Sheet5").Range("V6").Value = Sheets("Sheet1").Range("D5") ))))
End Sub


Thanks to everyone for viewing and helping me with this. Step by step I am starting to understand VBA.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
You don't need anything special to combine the code but you'll need to add to the code to reset all the dropdowns.
Code:
Private Sub Workbook_Open()

    MsgBox "Hello"

    Worksheets("Sheet2").Activate
    
    For I = 2 To 5
        Sheets("Sheet" & I).Range("V6").Value = Sheets("Sheet1").Range("D5")
    Next I

End Sub
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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