Link to home
Start Free TrialLog in
Avatar of Skip Sleeper
Skip Sleeper

asked on

How to use vba checkbox to enter text in a cell

Hi,

How do use a checkbox's value (True or False) to enter certain text in a single cell?  Also, could someone please explain how to decide which controls should be used (the Active X or Form controls)?

Thanks!
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

While you can use ActiveX controls on a worksheet, they can cause problems so it's best to always use Form controls on the worksheet. You use ActiveX controls on userforms.
With a Form control checkbox on a worksheet, you right click on it and select Assign Macro. You would then create a macro by that name and have Range("A1"). Value = "Some Text" as the code in the macro.
ASKER CERTIFIED SOLUTION
Avatar of Harry Lee
Harry Lee
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've been using ActiveX Controls for more than 2 years, on a daily basis, and had never have any problem.
Put an ActiveX listbox on a sheet, fill it with some data, and click it several times. You'll probably see the listbox change size. If you Google something like Excel ActiveX listbox problem you'll get lots of hits like this one.