#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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 ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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 ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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 ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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 ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help ! How do I do this in VB Script Sean Setting up and Configuration of Excel 3 March 17th 08 12:16 PM
VBA, VB Script and VB clara Excel Programming 1 January 14th 08 03:10 PM
Can I add this VB script to a VBA script? Designated Dave Excel Programming 3 April 8th 07 04:44 PM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM
what is a vb script george Excel Programming 1 July 16th 03 09:56 AM


All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"