My VB App reads a txt document and inserts the text into a richtxt box. Im trying to add 4 check boxes so if the user wants to exclude some data example values(1) and values(2) is their a short way of righting the code other than the example at the bottom. So if i say they uncheck Box 1 & 2 then it would remove the commas between each variable. That the user does not want to show but I need a comma between each one that does show.
If CK1 = True Then
CK1A = values(0)
If CK2 = True Then
CK2A = values(1)
If CK3 = True Then
CK3A = values(2)
If CK4 = True Then
CK4A = values(3)
FinalCK = CK1A & "," & CK2A & "," & CK3A & "," & CK4A
RTBReport.Text = RTBReport.Text & FinalCK & vbCrLf
Example when I run app with only the first CK1 checked it will show like this in the RTF
Hope I explained this good enough.