J
jrh
I created a form that uses radio buttons to populate class
rosters on a spreadsheet. Before, I would need to type in
the kid's name, the class they were taking, what day the
class was, who the teacher was, and how much the class
cost. Now, I just type in the kid's name and hit a radio
button for the class name. Hitting that class name
triggers the day, teacher, and cost to be populated on the
spreadsheet automatically. This saves time when actually
populating the spreadsheet, but when I have to update the
form with all new classes each time and then change the
code to populate certain things for that new class, this
ends up taking more time than doing it manually. Is there
a way I can write code that gives me another form where I
type in a class name with the corresponding teacher, day,
and cost once and this automatically upates the code that
popluates these things? Or is there another more
straightfoward way to do this that I don't see?
Here is an example of the code that is triggered when a
certain radio button (class name) is picked, in this case
Math.
'Transfer the Class
If OpMath Then Cells(NextRow, 5) = "Math"
'Transfer the Teacher
If OpMath Then Cells(NextRow, 6) = "Mrs. Smith"
'Transfer the Cost
If OpMath Then Cells(NextRow, 7) = 30
'Clear the controls for the next entry
OpMath = False
Clearing the radio buttons on the form, setting up new
radio buttons on the form, and then writing this code
takes too long. Can I just input the new data items in
boxes and have the vba do it all itself?
Thanks.
rosters on a spreadsheet. Before, I would need to type in
the kid's name, the class they were taking, what day the
class was, who the teacher was, and how much the class
cost. Now, I just type in the kid's name and hit a radio
button for the class name. Hitting that class name
triggers the day, teacher, and cost to be populated on the
spreadsheet automatically. This saves time when actually
populating the spreadsheet, but when I have to update the
form with all new classes each time and then change the
code to populate certain things for that new class, this
ends up taking more time than doing it manually. Is there
a way I can write code that gives me another form where I
type in a class name with the corresponding teacher, day,
and cost once and this automatically upates the code that
popluates these things? Or is there another more
straightfoward way to do this that I don't see?
Here is an example of the code that is triggered when a
certain radio button (class name) is picked, in this case
Math.
'Transfer the Class
If OpMath Then Cells(NextRow, 5) = "Math"
'Transfer the Teacher
If OpMath Then Cells(NextRow, 6) = "Mrs. Smith"
'Transfer the Cost
If OpMath Then Cells(NextRow, 7) = 30
'Clear the controls for the next entry
OpMath = False
Clearing the radio buttons on the form, setting up new
radio buttons on the form, and then writing this code
takes too long. Can I just input the new data items in
boxes and have the vba do it all itself?
Thanks.