Automatically split accounts Num

vask0

New Member
Joined
Mar 1, 2018
Messages
13
Hello I want to ask some have an idea..? how can i split these numbers automatically from the picture? with a script or no other idea ..

The idea is not to remove them manually one by one.

The idea is not to manually pull them out one by one, that sometimes there are a lot of accounts, and I have to download them manually and save them, thus hitting a lot of time. If there is any option at the end of it all will happen automatically or I will be more than happy to share a trick or a forum to do this thing ..

10!!!

accounts.png
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi & welcome to the board.
Is this what you want
Code:
Sub CopyData()

   Dim Ws1 As Worksheet
   Dim cl As Range
   
   Set Ws1 = Sheets("[COLOR=#ff0000]SalesRepData[/COLOR]")
   
   If Ws1.AutoFilterMode Then Ws1.AutoFilterMode = False
   With CreateObject("scripting.dictionary")
      For Each cl In Ws1.Range("A2", Ws1.Range("A" & Rows.Count).End(xlUp))
         If Not .exists(cl.Value) Then
            .Add cl.Value, Nothing
            Ws1.Range("A1").AutoFilter 1, cl.Value
            Worksheets.Add.Name = cl.Value
            Ws1.UsedRange.SpecialCells(xlVisible).Copy Range("A1")
         End If
      Next cl
   End With
   Ws1.AutoFilterMode = False
      
End Sub
Change sheet name in red to suit
 
Upvote 0
Hi & welcome to the board.
Is this what you want
Code:
Sub CopyData()

   Dim Ws1 As Worksheet
   Dim cl As Range
   
   Set Ws1 = Sheets("[COLOR=#ff0000]SalesRepData[/COLOR]")
   
   If Ws1.AutoFilterMode Then Ws1.AutoFilterMode = False
   With CreateObject("scripting.dictionary")
      For Each cl In Ws1.Range("A2", Ws1.Range("A" & Rows.Count).End(xlUp))
         If Not .exists(cl.Value) Then
            .Add cl.Value, Nothing
            Ws1.Range("A1").AutoFilter 1, cl.Value
            Worksheets.Add.Name = cl.Value
            Ws1.UsedRange.SpecialCells(xlVisible).Copy Range("A1")
         End If
      Next cl
   End With
   Ws1.AutoFilterMode = False
      
End Sub
Change sheet name in red to suit


Hi and congratulations on the good forum!!!

where do I need to write the code you provided me to try if it would work out
 
Upvote 0
I have asked this name in red with what name to replace it ..? with the file name or ..?

Rich (BB code):
Set Ws1 = Sheets("SalesRepData")
 
Upvote 0
The name of the sheet containing your data
 
Upvote 0

Forum statistics

Threads
1,215,309
Messages
6,124,180
Members
449,146
Latest member
el_gazar

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