adding items into 2 combo boxes on same userform error

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,259
Office Version
  1. 2010
Platform
  1. Windows
Hi, i have the code below and i am only able to add data into one combo box, it wont let me add anything into the other please can you help me, my code is below. thanks again for your time and advice.
Code:
Private Sub UserForm_Initialize()

ComboBox2.Clear

With ComboBox2
    .AddItem "Data"
    .AddItem "Errors"
    

End With

End Sub

Private Sub UserForm1_Initialize()

 ComboBox1.Clear

With ComboBox1

    .AddItem "Xmas"
    .AddItem "Birthday"
End With

End Sub
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
i assume you are after something like this

Code:
Private Sub UserForm_Initialize()

ComboBox2.Clear

With ComboBox2
    .AddItem "Data"
    .AddItem "Errors"
    

End With

 ComboBox1.Clear

With ComboBox1

    .AddItem "Xmas"
    .AddItem "Birthday"
End With


End Sub
 
Upvote 0
fantastic thank you very much, looks as though i am making minor errors, putting in to many errors, thank you for rectifying them for me much appreciated, i am still learning, only been learning this for 1 month and loving the coding :) thank you as well your forum is amazing and your help.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,265
Members
452,627
Latest member
KitkatToby

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