Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Magenta Ricci   on Feb 18 In MS Office Category.

  
Question Answered By: Chuong Tran   on Feb 18

The problem might be with "Locked". It isn't what you think it is. (I've
just read the MSDN explanation, and I can't really see what it is - just
what it isn't.)

I've just put a combo  box on my active sheet and hit it with code in a
command button click event. This works fine.

Option Explicit

Private Sub CommandButton1_Click()
If ComboBox1.Enabled Then
Range("A2") = "Unlocked"
ComboBox1.Enabled = False
ComboBox1.Value = "Export"
Else
Range("A2") = "Locked"
ComboBox1.Enabled = True
End If
End Sub

The box  is filled from a short cell  range, which includes "Export" as one of
the values (the last one, but that probably doesn't matter.) And the box is
linked to A1 where I can see that the value is being put in quite OK when I
disable the box and set its value.

Share: 

 

This Question has 11 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Changing the choice of a Combo Box via VBA Or get search suggestion and latest updates.


Tagged: