Hello,
I could use some help with a certain topic. I have an Excel sheet with multiple rows and columns. I sorted the rows based on the values in column A. I need to run a VBA script to loop through the worksheet so that whenever a row is found with the same value repeated in column A, a row would be generated on top of it, and the value of column A would be copied. The other cells in this new row shall be empty. So, if the input sheet is as follows:
then, the output sheet would be as follows:
It would also be helpful if the newly created rows (if any), are formatted in red color.
My main issue is, how do I ensure that if I re-run the script on the above output, a new row is not added over an already existing empty row.
So if I run the VBA script again, the following should NOT happen:
Thank you for the time and help.
I could use some help with a certain topic. I have an Excel sheet with multiple rows and columns. I sorted the rows based on the values in column A. I need to run a VBA script to loop through the worksheet so that whenever a row is found with the same value repeated in column A, a row would be generated on top of it, and the value of column A would be copied. The other cells in this new row shall be empty. So, if the input sheet is as follows:
Name | Property 1 | Property 2 |
ABC | 12A | 15B |
ABC | 14 | 15B |
XYZ | 5 | 3 |
PQR | 34C | 10 |
PQR | 22A | 46B |
PQR | 15 | 45R |
Name | Property 1 | Property 2 |
ABC | ||
ABC | 12A | 15B |
ABC | 14 | 15B |
XYZ | 5 | 3 |
PQR | ||
PQR | 34C | 10 |
PQR | 22A | 46B |
PQR | 15 | 45R |
My main issue is, how do I ensure that if I re-run the script on the above output, a new row is not added over an already existing empty row.
So if I run the VBA script again, the following should NOT happen:
Name | Property 1 | Property 2 |
ABC | ||
ABC | ||
ABC | 12A | 15B |
ABC | 14 | 15B |
XYZ | 5 | 3 |
PQR | ||
PQR | ||
PQR | 34C | 10 |
PQR | 22A | 46B |
PQR | 15 | 45R |
Thank you for the time and help.