Hi All,
Is their a macro code which can create new sheets for each unique value in a column and name the sheet that unique value?
For example:
Column A
Car
Van
motorbike
It would create three sheets: Car; van; motorbike
Help much appreciated.
Hi All,
Is their a macro code which can create new sheets for each unique value in a column and name the sheet that unique value?
For example:
Column A
Car
Van
motorbike
It would create three sheets: Car; van; motorbike
Help much appreciated.
Last edited by himynameisiain; 07-31-2013 at 08:59 AM.
Maybe:
![]()
Please Login or Register to view this content.
Hi John,
It is only pulling the first value through and not all the unique values in the column. Good start, im just not sure how to change that to look though the whole column. When i run the code above it puts one new tab named, then gives me the following error "run time 1004: method of range '_global' object failed
Try:
![]()
Please Login or Register to view this content.
Mumps,
Brilliant! Worked a treat to create new tabs with the names. Thank you.
You would happened to know a way which will then pull certain criteria in the same row but different columns into those tabs?
I would need to know which columns you want to copy.
Ok.
It would be columns: b,c,i,m,n
ty
I just want to clarify a few things. In your first post you saidDoes this mean that in column A there may be duplicate values? For example, there may be three occurrences of the word "Sample" in column A. Only one sheet named "Sample will be created. If this is the case, do you want the data from all three rows that have "Sample" in column A to be copied or are all the values in column A unique?each unique value in a column
Yes, there will be several "sample" in column A. However, the rest of the row is unique for that rows "sample".
I would like in our hypothetical situation the three "sample" instances to be copied over if possible?
Try:
![]()
Please Login or Register to view this content.
Hi Thanks. I have been modifying what you prescribe in the example as my deciding column is column c. However, i am stumped on how to get it to work for your latest post. If per chance you could see if anything im missing. Its bugging at the line highlighted in bold saying "subscript out of range"
![]()
Please Login or Register to view this content.
Use this code to avoid confusion:
Regarding the error you get, I am assuming that the sheet containg your data is called "Sheet1". If your sheet has a different name, you'll have to change "Sheet1" in the code to match your sheet name. If that's not the problem, please post a copy of your file. It would make it easier to find a solution when working with the actual data.![]()
Please Login or Register to view this content.
Brilliant, thanks! Solved!
(not sure how to change title)
Thank you for the feedback. It was my pleasure. To mark your thread solved do the following:
- Go to the first post
- Click edit
- Click Advance
- Just below the word "Title:" you will see a dropdown with the word No prefix.
- Change to Solve
- Click Save
done! thanks again!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks