Hi I am a beginner in VBA scripting but I am working on a sheet where I want to copy data in one cell to multiple cells in the same row as long as it is not empty but separate the two data by a comma and do this through out the table
Before Macro
<tbody>
</tbody>
<tbody>
</tbody>
Here is what I mean: I want the data in Column A (if there is data) to be duplicated through the row separated by a comma and possibly delete column A. I tried to use do-while loop with a formula but my issue is that the sheet is not fixed, meaning the length of rows and columns might vary depending on when the report is generated and I do this task weekly, some help in automating this will be a great help.
After Macro
<tbody>
</tbody>
Before Macro
A | B | C | D |
<tbody>
</tbody>
a | d | ||
b | d | ||
c | d | p | |
d | e | o | |
e | f | g | l |
f | e | x | f |
<tbody>
</tbody>
Here is what I mean: I want the data in Column A (if there is data) to be duplicated through the row separated by a comma and possibly delete column A. I tried to use do-while loop with a formula but my issue is that the sheet is not fixed, meaning the length of rows and columns might vary depending on when the report is generated and I do this task weekly, some help in automating this will be a great help.
After Macro
<s>A</s> | B | C | D |
<s>a</s> | a,d | ||
<s>b</s> | b,d | ||
<s>c</s> | c,d | c,p | |
<s>d</s> | d,e | d,o | |
<s>e</s> | e,f | e,g | e,l |
<s>f</s> | f,e | f,x | f,f |
<tbody>
</tbody>
Last edited: