Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Right now I have a spreadsheet with checkboxes and each one uses the
following code: Sub SelectYes1() Range("f6").Value = "=sheet1!b2" End Sub All it does is takes a value off sheet1 and then puts it into f6 but the only problem is, once it is unchecked the value isnt deleted so my formula bases off of that still includes that number in the total. Could someone let me know how to construct a macro that could delete the cell f6 when the checkboxe is unchecked. Thank you! -Trevor |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How about:
Sub SelectYes1() if activesheet.checkboxes(application.caller) = xlon then Range("f6").Value = "=sheet1!b2" else range("F6").value = 0 ' or "" to empty it end if End Sub This works for checkboxes from the Forms toolbar. And one of the nice things about these kinds of checkboxes is that you can assign the same macro to each of them. But then you have to figure out someway to know what to process. You could use the name; you could use the location. Or anything else that was unique. tnederlof wrote: Right now I have a spreadsheet with checkboxes and each one uses the following code: Sub SelectYes1() Range("f6").Value = "=sheet1!b2" End Sub All it does is takes a value off sheet1 and then puts it into f6 but the only problem is, once it is unchecked the value isnt deleted so my formula bases off of that still includes that number in the total. Could someone let me know how to construct a macro that could delete the cell f6 when the checkboxe is unchecked. Thank you! -Trevor -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro question | Excel Worksheet Functions | |||
Inputting data to one worksheet for it effect another | Excel Discussion (Misc queries) | |||
ranking query | Excel Discussion (Misc queries) | |||
delete duplicate record but only determine 1 column data | Excel Worksheet Functions | |||
Inserting a new line when external data changes | Excel Discussion (Misc queries) |