I need to move data to separate tabs depending on column B
And name the tab what is in column B
Attached example
I need to move data to separate tabs depending on column B
And name the tab what is in column B
Attached example
Last edited by x65140; 11-05-2021 at 09:08 AM.
There are 1st row empty left for any header of data on each of these new tabs (tweak code if you do not need them):
Please Login or Register to view this content.
Happy with my answer * Add Reputation.
If You are happy with solution, please use Thread tools and mark thread as SOLVED.
Works perfect !!!! Thanks KOKOSEK!!!!
Happy to help.
Thanks for rep.
Please try
PHP Code:
Sub tabs()
Dim r As Range, a, n&
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For n = 2 To Sheets.Count
Sheets(2).Delete
Next
n = Cells(Rows.Count, 2).End(xlUp).Row
For Each r In Range("B1:B" & n)
If Not Evaluate("isref('" & r.Value & "'!a1)") Then
Sheets.Add(, Sheets(Sheets.Count)).Name = r.Value
a = r.Parent.Evaluate(Replace("if(b1:b#=" & r.Address & ",row(1:#))", "#", n))
a = Application.Transpose(Filter(Application.Transpose(a), False, False))
a = Application.Index(r.Parent.Columns("a:d"), a, Array(1, 3, 4))
[a1].Resize(Application.CountIf(r.Parent.Columns(2), r.Value), 3) = a
End If
Next
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
IMHO not so easy to tweak in case of change of starting details.
Last edited by KOKOSEK; 11-05-2021 at 10:01 AM.
Please Login or Register to view this content.
My General Rules if you want my help. Not aimed at any person in particular:
1. Please Make Requests not demands, none of us get paid here.
2. Check back on your post regularly. I will not return to a post after 4 days.
If it is not important to you then it definitely is not important to me.
Works GREAT as well !!!! Thanks!!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks