• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Unique Name wise Sheet Create and data transfer

sambit

Member
Sir,
Kindly help to resolve the below mention issue.
Unique name wise sheet is generate and data transfer from main sheet to correspondence sheet.
Two Example file is attached
One file having name Example-1 (Data) is the problem file.
2nd file having name Example-1 (Desire Output) is the solution file.
 

Attachments

  • EXAMPLE-1 (Data).xlsx
    8.9 KB · Views: 9
  • EXAMPLE-1 (Desire Output).xlsx
    15.2 KB · Views: 8
Filter Column C for each sheet name and copy and paste to the appropriate sheet. If you wish to automate, then use the Macro Recorder to do one filter and then modify it to loop through each sheet name. If you have difficulty with the modification, then post back with your recorded macro and we will assist.
 
According to the attachment a VBA demonstration to paste to the Main Sheet worksheet module :​
Code:
Sub Demo1()
        Dim V, R&
    With [C2].CurrentRegion
        If .Rows.Count = 1 Then Beep: Exit Sub
        Application.ScreenUpdating = False
       .Columns(1).AdvancedFilter 2, , [K1], True
        [K1].CurrentRegion.Sort [K1], 1, Header:=1
            V = [K1].CurrentRegion.Value2
        For R = 2 To UBound(V)
            If Evaluate("ISREF('" & V(R, 1) & "'!A1)") Then Sheets(V(R, 1)).UsedRange.Clear _
                                                       Else Sheets.Add(, Sheets(Sheets.Count)).Name = V(R, 1)
            [K2].Value2 = V(R, 1)
           .AdvancedFilter 2, [K1:K2], Sheets(V(R, 1)).[A1]
            Sheets(V(R, 1)).UsedRange.Columns.AutoFit
        Next
    End With
        [K1].CurrentRegion.Clear
        Application.ScreenUpdating = True
End Sub
Do you like it ? So thanks to click on bottom right Like !​
 
Marc L Sir,
after inserting your code, Sheet is create and header data will also create but data will not transfer.
Example file attached for your kind information.

pl check the attached file.
 

Attachments

  • EXAMPLE-2 (Desire Output).xlsm
    23.6 KB · Views: 9
Last edited by a moderator:
As « solution belongs to good enough readers » so your bad as you did not well read & apply the dark red direction in my previous post !​
Just delete Module1 and paste the VBA procedure to the worksheet module …​
 
Back
Top