transfer data from sheet1 to multiple sheets based on names in specific column

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,429
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
hi
i hope to help any body about transfer data from sheet1 to multiple sheets the sheet1 contains data from a2:j i would transfer data every code existed in column j where every code to transfer to a new sheet and rename the sheet in column j for instance if the transfer data capital as what exist in column j the sheet's name is capital and so on the rest in code column j and transfer data from a2:j to relating sheet's name is capital and do for all rests i want this by code

88.JPG
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
How about
VBA Code:
Sub abdelfattah()
   Dim Cl As Range
   Dim Ws As Worksheet
   
   Set Ws = Sheets("Master")
   With CreateObject("scripting.dictionary")
      For Each Cl In Ws.Range("J2", Ws.Range("J" & Rows.Count).End(xlUp))
         If Not .Exists(Cl.Value) Then
            .Add (Cl.Value), Nothing
            Ws.Range("A1:J1").AutoFilter 10, Cl.Value
            Sheets.Add(, Sheets(Sheets.Count)).Name = Cl.Value
            Ws.AutoFilter.Range.Copy Range("A1")
         End If
      Next Cl
   End With
End Sub
Change sheet name to suit
 
Upvote 0
Do you have any blank cells in col J?
 
Upvote 0
From your image the values are in col I not J :unsure:
 
Upvote 0
yes i know but this is begins from col b i adjust your cod ranga b1 to j1 sorry about it but the error i t doesn't relate it as far as i know
 
Upvote 0
The only way I can get that error is if a cell in col J is blank.
Do any sheets get created?
 
Upvote 0
the only sheet is master it create the new sheet is capital but it's empty because the error code
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,258
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top