corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Any MS Excel experts


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Any MS Excel experts
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
4th Jun 04 at 12:40   View Garage View User's Profile U2U Member Reply With Quote

Im trying to do a VBScript in Excel that updates a Cell in Excel when an ActiveX Checkbox is checked, i.e. if its ticked say for instance cell B7 increases its number by 1

Any ideas i cant quite get it?
Chris Bingham
Member

Registered: 30th Mar 02
Location: In Scotland
User status: Offline
4th Jun 04 at 12:54   View User's Profile U2U Member Reply With Quote

Ok, this is how I just did it.

When you create a checkbox, right click it and select properties.

In the properties menu, you will see an option for 'Linked Cell'

type in a cell location. When the box is checked, TRUE appears in the linked cell location.

Then I would do an IF statement to say for example =if(A1=TRUE,1,0)

The do a sum of all your output cells - all the checked ones should have a 1, all non checked will have a 0. So when a new one is checked, it will increment by one.



[Edited on 04-06-2004 by Chris Bingham]
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
4th Jun 04 at 12:57   View Garage View User's Profile U2U Member Reply With Quote

wher do i put this if statement?
HeNdie
Member

Registered: 8th May 04
Location: Wigan. Drives:Saxo VTR!
User status: Offline
4th Jun 04 at 13:01   View User's Profile U2U Member Reply With Quote

do a macro.
Chris Bingham
Member

Registered: 30th Mar 02
Location: In Scotland
User status: Offline
4th Jun 04 at 13:05   View User's Profile U2U Member Reply With Quote

You will need an IF statement for each of the outputs so that it turns the output from TRUE to 1.
Chris Bingham
Member

Registered: 30th Mar 02
Location: In Scotland
User status: Offline
4th Jun 04 at 13:05   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by HeNdie
do a macro.


A macro to do what? Put in rubbish answers on posts?
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
4th Jun 04 at 13:07   View Garage View User's Profile U2U Member Reply With Quote

im trying to a macro but cant do it, im not sure of the commands
HeNdie
Member

Registered: 8th May 04
Location: Wigan. Drives:Saxo VTR!
User status: Offline
4th Jun 04 at 13:08   View User's Profile U2U Member Reply With Quote

instead of a checking box, have a tick box, when the tick box is clicked instead of checked, it does the macro, of what u want to happen, ie a box loses a number or somet.
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
4th Jun 04 at 13:09   View Garage View User's Profile U2U Member Reply With Quote

ok iv got it to flick a cell (H30) from 0 to 1 when i check or uncheck a box, now i have another check box and i want it to add or subtract to the figure in H30 when i check or uncheck the box?
Steve
Premium Member

Avatar

Registered: 30th Mar 02
Location: Worcestershire Drives: Defender
User status: Offline
4th Jun 04 at 13:10   View Garage View User's Profile U2U Member Reply With Quote

sorry i am using tick boxs, they are called check boxs in excel
Chris Bingham
Member

Registered: 30th Mar 02
Location: In Scotland
User status: Offline
4th Jun 04 at 13:28   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by GSiSteve
ok iv got it to flick a cell (H30) from 0 to 1 when i check or uncheck a box, now i have another check box and i want it to add or subtract to the figure in H30 when i check or uncheck the box?


Have a column which has all the 1's and 0's and then do a sum to add the totals.
blebo
Member

Registered: 18th Apr 02
User status: Offline
4th Jun 04 at 14:19   View User's Profile U2U Member Reply With Quote

In VB

If Range("??") = True then
cells("??").formular1c1 = Range("??") + 1

else

end if

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Help needed again ...Trotty can you help Red_Corsa Geek Day 17 1677
21st Mar 03 at 00:15
by Red_Corsa
 
koni red suspension kit jam Help Zone, Modification and ICE Advice 5 906
25th Mar 03 at 17:48
by jam
 
need wheel refurb plce in derby area/notts any 1 no any + wanted spoiler mintgreencorsa Classifieds 3 793
28th Mar 03 at 21:24
by mentalcorsa
 
Scoob & Lotus Esprit Turbo Marc General Chat 3 836
18th Jan 04 at 20:25
by Drew
 
Programming Question Mav 3000 Geek Day 4 1191
31st Mar 04 at 19:08
by Mav 3000
 

Corsa Sport » Message Board » Off Day » Geek Day » Any MS Excel experts 28 database queries in 0.0095379 seconds