pjmsimmons
Board Regular
- Joined
- Dec 13, 2011
- Messages
- 80
Hi All,
I have two columns of data H & N in a worksheet 'Sample Details' and I am looking for some code that will do the following. Unfortunately its outside of my present skill set with VBA.
For each selected X in a sample worksheet concatenate the data in x.offset (0,6) and x.offset (0,12) onto a single line (space between the concatenated data) and each concatenation separated by a semicolon e.g. on a different worksheet 'Text message'
eg
1) the data is presented thus on worksheet 'Sample Details'. (numbers should be under column 7 and UTD/NUTD under column 13 on the example below).
Column 1.........Column 7.............Column 13
A 1234 UTD
A 2356 UTD
A 7521 NUTD
A A345 UTD
B 4589 UTD
B 1256 NUTD
I select each row marked A in column 1 and the code would concatenate the four lines as follows and places it in the next available row in column B on the worksheet 'Text message'
1234 UTD; 2356 UTD, 7521 NUTD, A345 UTD
I then select each row marked B in column 1 and the process is repeated such that the following would now appear on the worksheet 'Text Message'
1234 UTD; 2356 UTD, 7521 NUTD, A345 UTD
4589 UTD; 1256 NUTD
I hope someone can help as I'm stuck at the moment .
regards,
Paul
I have two columns of data H & N in a worksheet 'Sample Details' and I am looking for some code that will do the following. Unfortunately its outside of my present skill set with VBA.
For each selected X in a sample worksheet concatenate the data in x.offset (0,6) and x.offset (0,12) onto a single line (space between the concatenated data) and each concatenation separated by a semicolon e.g. on a different worksheet 'Text message'
eg
1) the data is presented thus on worksheet 'Sample Details'. (numbers should be under column 7 and UTD/NUTD under column 13 on the example below).
Column 1.........Column 7.............Column 13
A 1234 UTD
A 2356 UTD
A 7521 NUTD
A A345 UTD
B 4589 UTD
B 1256 NUTD
I select each row marked A in column 1 and the code would concatenate the four lines as follows and places it in the next available row in column B on the worksheet 'Text message'
1234 UTD; 2356 UTD, 7521 NUTD, A345 UTD
I then select each row marked B in column 1 and the process is repeated such that the following would now appear on the worksheet 'Text Message'
1234 UTD; 2356 UTD, 7521 NUTD, A345 UTD
4589 UTD; 1256 NUTD
I hope someone can help as I'm stuck at the moment .
regards,
Paul
Last edited: