Hi all
Hope someone can help here. My knowledge of VBA is pretty basic, so please bear with me. I will try to explain what I need as best I can!
I want to create some code that will locate instances of text in 1 column within my data where the text changes, and I would like a row added above that instance. There are a set number of text strings that will be used within this column, and the data will already be sorted so that groups of the same text string sit together. I need to add a row above each grouping.
Within this row I need to add the text string found within the column in cell 1. When all of the rows have been added and the text added, the column the search was completed in can be deleted.
For example, I have data in columns A to P with a title row. The column I need to use to search with is column E. Within this column the following instances may be used:
Adults
Mental Health
In-House
Strategic
External Provider
So I need Excel to add a blank row above the "Adults" section. After a number of rows (different each time) the text in column E will change to something else. Above the new text sting I would need a new row adding and the new text adding in Cell 1 for this row.
I won't know how much data I will have each time I use the code - it will change each time. Also, it could be the case that one of the instances (e.g. Mental Health) will not appear at all - can this be accounted for?
I hope this makes sense and someone can help! I've added a basic example of what I am looking for.
Bookmarks