|Since macros need to be very specific about where they find data, we need more specifics related to your example data.|
You did not include Row or Column labels, so we can't offer anything specific at this point.
Let me take a guess at what you are looking for and you can fix whatever I get wrong.
1 - In Column A, you have the text Location Code : in various cells.
2 - In Column B, on the same Row as Location Code : you have a value, e.g. 161, 152, etc.
3 - Skipping one blank Row after the Location Code :, you have data that extends down to 1 blank Row above the next occurrence of Location Code :.
4 - Each time the text Location Code : is found in Column A, you want to create a new tab, named for the Location Code : found in Column B of that Row.
5 - Once the new tab is created, you want to copy the data mentioned in Step 3 above to that tab.
Assuming I've got most of that right, I have some questions:
Will any Location Codes be repeated, meaning that more one set of data will need to be copied to the same tab?
Is this a one time thing or an on-going process where data sets will need to be pasted below existing data sets on tabs that already exist?
Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.