There are 30 checkboxes that need to have their caption compared to a cell value.
The basic code is repeated 30 times for 30 different check boxes
The only Lines that Change per CheckBox are the Following:
- The First Line -
CheckBox3.Value
(will increase by 1 for every checkbox) - Fourth Line from Bottom -
Cells(eRow, 24).Value = Controls("CheckBox" & 3).Caption
(Needs to match Checkbox Selected (3, 4, 5 etc.)) - Third Line from Bottom -
Cells(eRow, 25).Value = TextBox11.Value
(will increase by 1 for every checkbox)
The basic block is:
If CheckBox3.Value = True Then
eRow = Sheet3.Cells(Rows.Count, 6).End(xlUp).Offset(1, 0).Row
Cells(eRow, 7).Value = ComboBox1.Value
If CheckBox29.Value = True Then
Cells(eRow, 8).Value = Controls("CheckBox" & 29).Caption
If CheckBox1.Value = True Then
Cells(eRow, 14).Value = "Yes"
Else
Cells(eRow, 14).Value = "No"
End If
Cells(eRow, 15).Value = ComboBox6.Value
Cells(eRow, 16).Value = ComboBox7.Value
If CheckBox2.Value = True Then
Cells(eRow, 17).Value = "Yes"
Else
Cells(eRow, 17).Value = "No"
End If
Cells(eRow, 18).Value = ComboBox8.Value
Cells(eRow, 19).Value = TextBox5.Value
Cells(eRow, 20).Value = TextBox6.Value
Cells(eRow, 21).Value = TextBox7.Value
Cells(eRow, 22).Value = TextBox8.Value
Cells(eRow, 26).Value = TextBox9.Value
Cells(eRow, 27).Value = TextBox10.Value
Else
Cells(eRow, 8).Value = "Sales Call"
Cells(eRow, 15).Value = "-"
Cells(eRow, 16).Value = "-"
Cells(eRow, 18).Value = "-"
Cells(eRow, 19).Value = "-"
Cells(eRow, 20).Value = "-"
Cells(eRow, 21).Value = "-"
Cells(eRow, 22).Value = "-"
Cells(eRow, 26).Value = "-"
Cells(eRow, 27).Value = "-"
Cells(eRow, 14).Value = "No"
Cells(eRow, 17).Value = "No"
End If
Cells(eRow, 9).Value = ComboBox3.Value
Cells(eRow, 10).Value = TextBox2.Value
Cells(eRow, 11).Value = TextBox3.Value
Cells(eRow, 12).Value = TextBox4.Value
Cells(eRow, 13).Value = ComboBox4.Value
Cells(eRow, 23).Value = ComboBox5.Value
Cells(eRow, 24).Value = Controls("CheckBox" & 3).Caption
Cells(eRow, 25).Value = TextBox11.Value
Cells(eRow, 6).Value = TextBox1.Value
End If
The above code is repeated another 29 times with those three lines changed to match the corresponding checkbox.
Addendum
I have the Linked Spread Sheet - Follow Up Spread Sheet
Basically I created a userform for my sales reps to fill out with there sales calls. we have approximately 30 different product lines so I made it where they could enter one call and if they talked about more than one of our lines they could just check they box and add a comment. so in theory if they talked about all the products we offer the one call would have 30 new lines in the spreadsheet.
The macro works great and does what it needs to but the problem I am running into was with 32 bit Excel versions they would get an error saying file is to large so I broke the code into 2 which isn't very efficient.
I am trying to use loops and arrays but since I am teaching myself how to code I am running into issues.