User Form repeat values based on choices

fergal78

New Member
Joined
May 12, 2015
Messages
1
Hi,

Thanks to all the posts on here I have been able to copy, paste, butcher and fudge my way through to almost what I need.

I have a sheet with multiple columns with a list of sites which we may visit to carry out a Test, service, Repair or any combination of the three.

[TABLE="width: 212"]
<tbody>[TR]
[TD]Site A
[/TD]
[/TR]
[TR]
[TD]Site B
[/TD]
[/TR]
[TR]
[TD]Site C
[/TD]
[/TR]
</tbody>[/TABLE]

Based on the checkbox selection I want to copy each row to create a new line for each visit type with visit type text added to each row.

E.g. if all three are selected each row would be copied e times and each visit type added to the line
[TABLE="width: 531"]
<tbody>[TR]
[TD]Site A
[/TD]
[TD]Test
[/TD]
[/TR]
[TR]
[TD]Site A
[/TD]
[TD]Service
[/TD]
[/TR]
[TR]
[TD]Site A
[/TD]
[TD]Repair
[/TD]
[/TR]
[TR]
[TD]Site B
[/TD]
[TD]Test
[/TD]
[/TR]
[TR]
[TD]Site B
[/TD]
[TD]Service
[/TD]
[/TR]
[TR]
[TD]Site B
[/TD]
[TD]Repair
[/TD]
[/TR]
[TR]
[TD]Site C
[/TD]
[TD]Test
[/TD]
[/TR]
[TR]
[TD]Site C
[/TD]
[TD]Service
[/TD]
[/TR]
[TR]
[TD]Site C
[/TD]
[TD]Repair
[/TD]
[/TR]
</tbody>[/TABLE]

If there are and two option ticked then each line would be added twice and the two visit types added
So far I have managed to create the form count the number of checkboxes that have been ticked and use that value to copy the lines down the sheet.

I am struggling to find a way to add the text to each line particularly when the not all three are selected.

Any help would be greatly appreciated. Andy thank you all for the bits of code I have managed to cobble together so far.:)
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top