Hi,
Please can someone help, i'm trying to create a combobox with the list "buy and sell" but keep getting the error message "run-time error 70: permission denied".
![]()
Private Sub ComboBox2_Change() ComboBox2.AddItem "Buy", "Sell" End Sub
Hi,
Please can someone help, i'm trying to create a combobox with the list "buy and sell" but keep getting the error message "run-time error 70: permission denied".
![]()
Private Sub ComboBox2_Change() ComboBox2.AddItem "Buy", "Sell" End Sub
Last edited by Fotis1991; 05-24-2014 at 03:44 AM. Reason: pls use code tags around your codes
If your combobox is inserted in a worksheet, try this macro that you will place in specific sheet in VBE
It will trigger every time the sheet is activated. It could also be placed in ThisWorkbook section and be triggered by the workbook openning (Private Sub Workbook_Open())![]()
Private Sub Worksheet_Activate() ComboBox1.AddItem "Buy" ComboBox1.AddItem "Sell" End Sub
If you are using your combobox in a userform, you should put this code in "Private Sub UserForm_Initialize()"
Pierre Leclerc
_______________________________________________________
If you like the help you got,
Click on the STAR "Add reputation" icon at the bottom.
If your combobox is inserted in a worksheet, try this macro that you will place in specific sheet in VBE
It will trigger every time the sheet is activated. It could also be placed in ThisWorkbook section and be triggered by the workbook openning (Private Sub Workbook_Open())![]()
Private Sub Worksheet_Activate() ComboBox1.AddItem "Buy" ComboBox1.AddItem "Sell" End Sub
If you are using your combobox in a userform, you should put this code in "Private Sub UserForm_Initialize()"
Try this.
![]()
Private Sub UserForm_Initialize() Me.ComboBox2.List = Array("Buy", "Sell" End Sub
If posting code please use code tags, see here.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks