ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Workbook Open event (https://www.excelbanter.com/excel-programming/295824-workbook-open-event.html)

Todd huttenstine

Workbook Open event
 
Hey guys, how do I add the value, in the code below ("Jan
Week 1") to combobox1 on sheet Pivot WOW REPS? The below
code is not working. I get an error.


Private Sub Workbook_Open()
ComboBox1.AddItem "Jan Week 1"
End sub

Thanks
Todd Huttenstine

Jim Rech

Workbook Open event
 
You have to tell VB what sheet the combobox is on:

Private Sub Workbook_Open()
Sheet1.ComboBox1.AddItem "Jan Week 1"
End Sub

Replace "Sheet1" with the code name of the correct worksheet.

--
Jim Rech
Excel MVP

"Todd Huttenstine" wrote in message
...
| Hey guys, how do I add the value, in the code below ("Jan
| Week 1") to combobox1 on sheet Pivot WOW REPS? The below
| code is not working. I get an error.
|
|
| Private Sub Workbook_Open()
| ComboBox1.AddItem "Jan Week 1"
| End sub
|
| Thanks
| Todd Huttenstine




All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com