ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB script (https://www.excelbanter.com/excel-programming/418352-vbulletin-script.html)

Archie Hernandez

VB script
 
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 ***

joel

VB script
 
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.

"Archie Hernandez" wrote:

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 ***


Archie Hernandez

VB script
 
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 ***

joel

VB script
 
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")

"Archie Hernandez" wrote:

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 ***



All times are GMT +1. The time now is 08:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com