ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Write selection (https://www.excelbanter.com/excel-programming/331526-write-selection.html)

starfighter61

Write selection
 
Hello
If i have a button and 4 checkboxes and each refer to some numbers
1 checkbox is for 1, 2, 3 and 4
2 checkbox is for 5, 6, 7 and 8
3 checkbox is for 9, 10, 11, 12
4 checkbox is for 13, 14, 15 and 16

If i check lets say 1, 3 and 4
i like to write the numbers in cells
like this

1
2
3
4

9
10
11
12

13
14
15
16

with one empty cell between each group of number
someone pleas help

Tushar Mehta

Write selection
 
What have you tried so far? Where are you stuck?

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hello
If i have a button and 4 checkboxes and each refer to some numbers
1 checkbox is for 1, 2, 3 and 4
2 checkbox is for 5, 6, 7 and 8
3 checkbox is for 9, 10, 11, 12
4 checkbox is for 13, 14, 15 and 16

If i check lets say 1, 3 and 4
i like to write the numbers in cells
like this

1
2
3
4

9
10
11
12

13
14
15
16

with one empty cell between each group of number
someone pleas help


Bill Kuunders

Write selection
 
First each check box needs a cell link.
to do this
right click on the check box and select <format control<control<enter
cell link address
for this example B1 B2 B3 and B4
This will cause the nominated cells to show a true or false value.

Are you ready for this????
Just copy the formula's and paste them into the worksheet.

In A11 enter
=IF(B1=TRUE,1,IF(B2=TRUE,5,IF(B3=TRUE,9,IF(B4=TRUE ,13,""))))
In A12 enter
=IF(B1=TRUE,2,IF(B2=TRUE,6,IF(B3=TRUE,10,IF(B4=TRU E,14,""))))
In A13 enter
=IF(B1=TRUE,3,IF(B2=TRUE,7,IF(B3=TRUE,11,IF(B4=TRU E,15,""))))
in A14 enter
=IF(B1=TRUE,4,IF(B2=TRUE,8,IF(B3=TRUE,12,IF(B4=TRU E,16,""))))

In A16 enter
=IF(AND(B1=TRUE,B2=TRUE),5,IF(AND(OR(B1=TRUE,B2=TR UE),B3=TRUE),9,IF(AND(OR(B1=TRUE,B2=TRUE,B3=TRUE), B4=TRUE),13,"")))
In A17 enter
=IF(AND(B1=TRUE,B2=TRUE),6,IF(AND(OR(B1=TRUE,B2=TR UE),B3=TRUE),10,IF(AND(OR(B1=TRUE,B2=TRUE,B3=TRUE) ,B4=TRUE),14,"")))
In A18 enter
=IF(AND(B1=TRUE,B2=TRUE),7,IF(AND(OR(B1=TRUE,B2=TR UE),B3=TRUE),11,IF(AND(OR(B1=TRUE,B2=TRUE,B3=TRUE) ,B4=TRUE),15,"")))
In A19 enter
=IF(AND(B1=TRUE,B2=TRUE),8,IF(AND(OR(B1=TRUE,B2=TR UE),B3=TRUE),12,IF(AND(OR(B1=TRUE,B2=TRUE,B3=TRUE) ,B4=TRUE),16,"")))

in A21 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE),9,IF(AND(B1=FALSE ,B2=TRUE,B3=TRUE,B4=TRUE),13,IF(AND(B1=TRUE,B2=FAL SE,B3=TRUE,B4=TRUE),13,IF(AND(B1=TRUE,B2=TRUE,B3=F ALSE,B4=TRUE),13,"
"))))
in A22 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE),10,IF(AND(B1=FALS E,B2=TRUE,B3=TRUE,B4=TRUE),14,IF(AND(B1=TRUE,B2=FA LSE,B3=TRUE,B4=TRUE),14,IF(AND(B1=TRUE,B2=TRUE,B3= FALSE,B4=TRUE),14,"
"))))
in A23 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE),11,IF(AND(B1=FALS E,B2=TRUE,B3=TRUE,B4=TRUE),15,IF(AND(B1=TRUE,B2=FA LSE,B3=TRUE,B4=TRUE),15,IF(AND(B1=TRUE,B2=TRUE,B3= FALSE,B4=TRUE),15,"
"))))
in A24 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE),12,IF(AND(B1=FALS E,B2=TRUE,B3=TRUE,B4=TRUE),16,IF(AND(B1=TRUE,B2=FA LSE,B3=TRUE,B4=TRUE),16,IF(AND(B1=TRUE,B2=TRUE,B3= FALSE,B4=TRUE),16,"
"))))
in A26 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE,B4=TRUE),13,"")
in A27 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE,B4=TRUE),14,"")
in A28 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE,B4=TRUE),15,"")
in A29 enter
=IF(AND(B1=TRUE,B2=TRUE,B3=TRUE,B4=TRUE),16,"")

It took a while and there are probably a dozen other ways to
achieve the same result but it was interesting.
Have fun.

Greetings from New Zealand
Bill K


"starfighter61" wrote in message
...
Hello
If i have a button and 4 checkboxes and each refer to some numbers
1 checkbox is for 1, 2, 3 and 4
2 checkbox is for 5, 6, 7 and 8
3 checkbox is for 9, 10, 11, 12
4 checkbox is for 13, 14, 15 and 16

If i check lets say 1, 3 and 4
i like to write the numbers in cells
like this

1
2
3
4

9
10
11
12

13
14
15
16

with one empty cell between each group of number
someone pleas help






All times are GMT +1. The time now is 03:56 PM.

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