VB script

A

Archie Hernandez

Need help writing a VB Script for Excel.

I'm using Excel 2004 (version 11.5.1) and have created an Excel sheet
that has
an area to enter a variable or numerical number (Cell, E1). Then I have
12
checkboxes on the left of Excel Sheet, which I created with the Form
Toolbox.
What I would like to do is be able to enter the variable in the E1 Cell,
then check
off one of the checkboxes and have that variable appear in another Cell
(E3, E5,
or E7). If multiple checkboxes are checked, then I would like the
variables to
increase in value by one (e.g. Original Variable in E1 Cell + 1).

Does anyone have any suggestions?

Cheers!

*** Sent via Developersdex http://www.developersdex.com ***
 
J

Joel

You don't need a macro! You need to set the cell link property of the check
box.

Have the first check box linked to D3, 2nd D5, 3rd D7,... the results will
be either true or False. then use a worksheet formula to get your results.


To add the Cell Link property of the check box select the check box so it
gets highlighted like a picture. Then press property on the Toolbox - forms
(the icon with the finger). Then one the Control Tab of the proerty box
enter the cell Link location.
 
A

Archie Hernandez

Hi Joel,

Thanks for the advice. I did what you stated but I was unable to add a
formula
that stuck. Everytime I added a formula, the formula works but as soon
as I click
on the Checkbox, then the formula gets erased and a True/False variable
appears in the cell. Any suggestions?

Best,
Archie




*** Sent via Developersdex http://www.developersdex.com ***
 
J

Joel

You don't put a formula in the linked cell. Your formula should refer to the
link cell expecting a true or false entry in the linked cell.

If the link cell is C3 then in cell C5 you can have a formula
=if(C3=true,"Check box 1 is true","Check box 1 is false")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top