eriden
04-20-2015, 06:01 AM
Hello!
I would like to create a macro in VBA but I'm really struggling. I need the macro to do the following:
Go through the entire column A and check whether it has a cell that has a length of 4. If this is true then:
Grab the value from the same row in column B. Also add values from the next rows in column B using " | " as a seperator until either:
* The cell.value in Column B is empty OR
* The length of that row in Column A has 4 numbers.
Continue checking for length in Column A until it has looped through the entire worksheet.
I know this is a lot to ask, but I would be for ever grateful if someone could help me with this.
I have managed to get the macro to loop through A and check for cell length, but that's kind of where my knowledge stops.
Thanks a lot in advance! :-)
When finished I would like the macro to create column C (Based on Column B) as follows:
A
B
C
1234
Text1
Text1 | Text2 | Text3
Text2
Text3
2345
Text1
Text1 | Text2 | Text3 | Text4
Text2
Text3
Text4
3456
Text1
Text1 | Text2
Text2
4567
Text1
Text1 | Text2 | Text3
Text2
Text3
I would like to create a macro in VBA but I'm really struggling. I need the macro to do the following:
Go through the entire column A and check whether it has a cell that has a length of 4. If this is true then:
Grab the value from the same row in column B. Also add values from the next rows in column B using " | " as a seperator until either:
* The cell.value in Column B is empty OR
* The length of that row in Column A has 4 numbers.
Continue checking for length in Column A until it has looped through the entire worksheet.
I know this is a lot to ask, but I would be for ever grateful if someone could help me with this.
I have managed to get the macro to loop through A and check for cell length, but that's kind of where my knowledge stops.
Thanks a lot in advance! :-)
When finished I would like the macro to create column C (Based on Column B) as follows:
A
B
C
1234
Text1
Text1 | Text2 | Text3
Text2
Text3
2345
Text1
Text1 | Text2 | Text3 | Text4
Text2
Text3
Text4
3456
Text1
Text1 | Text2
Text2
4567
Text1
Text1 | Text2 | Text3
Text2
Text3