usnapoleon
Board Regular
- Joined
- May 22, 2014
- Messages
- 110
- Office Version
- 365
- Platform
- Windows
Hello
I have an existing Macro that I got from a cool person on here where, upon checking 1 box it would uncheck any others, thus preventing errors. I need some help again, and the difference now is that I have 2 sets of checkboxes that are independent of each other. However, when I check 1 on one side, it unchecks the box on the other side. I'll show you:
columns C-G are the original checkboxes, and the VBA Macro was built for them originally. I added the 2nd set of I-L to the spreadsheet. C-G are independent of columns I-L. There has to be 1 box checked in each group but it's not letting me.
Here is the VBA macro coding that is assigned:
I know nothing of VBA so I couldnt even attempt to review and try to modify this. I have a feeling I need a 2nd macro for the new checkboxes in columns I-L. I'm just guessing though.
I have an existing Macro that I got from a cool person on here where, upon checking 1 box it would uncheck any others, thus preventing errors. I need some help again, and the difference now is that I have 2 sets of checkboxes that are independent of each other. However, when I check 1 on one side, it unchecks the box on the other side. I'll show you:
Voucher Spreadsheet.xlsm | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | |||
16 | ||||||||||||||||
17 | Voucher Itemization | |||||||||||||||
18 | Department | Voucher Type | ||||||||||||||
19 | CG | MP | PH | SH | TH | RW | FV | SB | TH | Not Reduced | ||||||
20 | Cashier Name | Ck # | Canyon Grille | Market Place | Pizza Hut | The Shop | Theater | Dept | Resort Wide | Food Voucher | Starbucks | Theater | Type | AMOUNT | ||
21 | SH | 5.00 | ||||||||||||||
1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H21 | H21 | =IFERROR(INDEX($C$19:$G$19,MATCH(TRUE,C21:G21,0)),"") |
M21 | M21 | =IFERROR(INDEX($I$19:$L$19,MATCH(TRUE,I21:L21,0)),"") |
columns C-G are the original checkboxes, and the VBA Macro was built for them originally. I added the 2nd set of I-L to the spreadsheet. C-G are independent of columns I-L. There has to be 1 box checked in each group but it's not letting me.
Here is the VBA macro coding that is assigned:
VBA Code:
Option Explicit
Sub Change_Check_Boxes()
Dim c As Excel.CheckBox, cx As Excel.CheckBox
Set c = ActiveSheet.CheckBoxes(Application.Caller)
For Each cx In ActiveSheet.CheckBoxes
If cx.TopLeftCell.Column <> c.TopLeftCell.Column _
And cx.TopLeftCell.Row = c.TopLeftCell.Row Then cx.Value = xlOff
Next cx
End Sub
I know nothing of VBA so I couldnt even attempt to review and try to modify this. I have a feeling I need a 2nd macro for the new checkboxes in columns I-L. I'm just guessing though.