Hi. I wish to concatenate a list if it meets a specific requirement.
The code that works when entering into excel worksheet looks like this:
[FONT=Arial, sans-serif]=IF(C7="","",CONCATENATE("Including:",IF($C7=$C$19,$E$19&",",""),IF($C7=$C$20,$E$20&",",""),IF($C7=$C$21,$C$21&",",""),IF($C7=$C$22,$E$22&",",""),IF($C7=$C$23,$C$23&",",""),IF($C7=$C21,$C21&",",""),IF($C7=$C$25,$C$25&",",""),IF($C7=$C$26,$E$26&",",""),IF($C7=$C$27,$E$27&",",""),IF($C7=$C$28,$C$28&",",""),IF($C7=$C$29,$E$29&",",""),IF($C7=$C$30,$C$30&",",""),IF($C7=$C$31,$E$31&",",""),IF($C7=$C$32,$C$32&",",""),IF($C7=$C$33,$E$33&",",""),IF($C7=$C$34,$E$34&",",""),IF($C7=$C$35,$C$35&",",""),IF($C7=$C$36,$E$36&",",""),IF($C7=$C$37,$C$37&",",""),IF($C7=$C$38,$E$38&",",""),IF($C7=$C$39,$E$39&",",""),IF($C7=$C$40,$C$40&",",""),IF($C7=$C$41,$E$41&",",""),IF($C7=$C$42,$C$42&",",""),IF($C7=$C$43,$E$43&",",""),IF($C7=$C$44,$C$44&",",""),IF($C7=$C$45,$E$45&",",""),IF($C7=$C$46,$C$46&",",""),IF($C7=$C$47,$E$47&",","")))[/FONT]
[FONT=Arial, sans-serif]VBA really does not like when i try to insert this code in to a cell using the .Formula ("function"?) function.
[/FONT]
MY QUESTION, therefore is how would i enter this into VBA to get the result that i see in the front end of excel when i use the above code?
[FONT=Arial, sans-serif]To provide some context. I have a category of control, which has numerous sub controls. I am noting the description of the category control as the concatenation of the sub controls.
The form is for front users to populate therefore i have used this code to make it as fail proof as possible.
Thank you
Kevin[/FONT]
The code that works when entering into excel worksheet looks like this:
[FONT=Arial, sans-serif]=IF(C7="","",CONCATENATE("Including:",IF($C7=$C$19,$E$19&",",""),IF($C7=$C$20,$E$20&",",""),IF($C7=$C$21,$C$21&",",""),IF($C7=$C$22,$E$22&",",""),IF($C7=$C$23,$C$23&",",""),IF($C7=$C21,$C21&",",""),IF($C7=$C$25,$C$25&",",""),IF($C7=$C$26,$E$26&",",""),IF($C7=$C$27,$E$27&",",""),IF($C7=$C$28,$C$28&",",""),IF($C7=$C$29,$E$29&",",""),IF($C7=$C$30,$C$30&",",""),IF($C7=$C$31,$E$31&",",""),IF($C7=$C$32,$C$32&",",""),IF($C7=$C$33,$E$33&",",""),IF($C7=$C$34,$E$34&",",""),IF($C7=$C$35,$C$35&",",""),IF($C7=$C$36,$E$36&",",""),IF($C7=$C$37,$C$37&",",""),IF($C7=$C$38,$E$38&",",""),IF($C7=$C$39,$E$39&",",""),IF($C7=$C$40,$C$40&",",""),IF($C7=$C$41,$E$41&",",""),IF($C7=$C$42,$C$42&",",""),IF($C7=$C$43,$E$43&",",""),IF($C7=$C$44,$C$44&",",""),IF($C7=$C$45,$E$45&",",""),IF($C7=$C$46,$C$46&",",""),IF($C7=$C$47,$E$47&",","")))[/FONT]
[FONT=Arial, sans-serif]VBA really does not like when i try to insert this code in to a cell using the .Formula ("function"?) function.
[/FONT]
MY QUESTION, therefore is how would i enter this into VBA to get the result that i see in the front end of excel when i use the above code?
[FONT=Arial, sans-serif]To provide some context. I have a category of control, which has numerous sub controls. I am noting the description of the category control as the concatenation of the sub controls.
The form is for front users to populate therefore i have used this code to make it as fail proof as possible.
Thank you
Kevin[/FONT]