How to Distribute data from a master tab to team tabs?

DDubya

New Member
Joined
Jan 19, 2021
Messages
8
Office Version
  1. 2019
Platform
  1. Windows
Hello,
I'm looking to figure out how I can distribute from a Master tab to a multiple of other tabs within the same workbook.

I'm fairly new to Excel, self learning, but for some reason I cannot wrap my head around how to create this.

I appreciate any help I can get.

Thank you in advance.
 

Attachments

  • Master Sheet.jpg
    Master Sheet.jpg
    127.1 KB · Views: 28
  • TMs Tab.jpg
    TMs Tab.jpg
    46.3 KB · Views: 29

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hope this helps.

VBA Code:
Sub sample()
Dim Mws As Worksheet, tgws As Worksheet
Dim rng As Range, c
Set Mws = Sheets("M.A")

With Mws
    Set rng = .Range(.Range("C3"), .Cells(Rows.Count, 5).End(xlUp))
    For Each c In .Range(.Range("A3"), .Cells(Rows.Count, 1).End(xlUp))
        rng.Copy Sheets(c.Value).Range("A8")
    Next
End With
End Sub
 
Upvote 0
Hope this helps.

VBA Code:
Sub sample()
Dim Mws As Worksheet, tgws As Worksheet
Dim rng As Range, c
Set Mws = Sheets("M.A")

With Mws
    Set rng = .Range(.Range("C3"), .Cells(Rows.Count, 5).End(xlUp))
    For Each c In .Range(.Range("A3"), .Cells(Rows.Count, 1).End(xlUp))
        rng.Copy Sheets(c.Value).Range("A8")
    Next
End With
End Sub
Hello Takae,

I appreciate your assistances here. The only thing is that it copied all the data into all the TM tabs, and I need them to distribute them, so that each TM has their own.
If that makes sense.

How do I take what you have and have it distribute each account individually to each TM?

Thank you again, much appreciated.
 
Upvote 0
How do you want to distribute? If you have sheet name on column F(like columna A) on M.A sheet, it can distribute the data according to the sheet name.
For example, which sheet should the first data 1234567800/ST/45 should go?
 
Upvote 0
How do you want to distribute? If you have sheet name on column F(like columna A) on M.A sheet, it can distribute the data according to the sheet name.
For example, which sheet should the first data 1234567800/ST/45 should go?
Hi Takae,

So your VBA code added all accounts to all tabs. I was trying to get it to distribute the first account to the first tab, the second account to the second tab and so forth. When it comes to the end of the names (column A) then it was start at the top again, and continue to distribute the accounts out.

I appreciate all the help, thank you Takae for taking the time to assist me.
 
Upvote 0
Is it possible to have a check box next to those names to signal that YES they should distribute to that tab?
 

Attachments

  • 1611681552046.png
    1611681552046.png
    49.8 KB · Views: 5
Upvote 0
I still don't know what you want to do. How would you like to display it on the first TM1 sheet? It would be possible to put checkboxes, but what data should be displayed on which sheet when it is turned on?






 
Upvote 0
Hi Takae,

I attached new images color coding to hopefully help my idea come across easier.

So each account will distribute to one of the TM's tab, then move down to distribute the next account to the next tab, and so forth.

I also added (Y/N) drop downs just to signify whether that TM should have account distributed to it.

Thank you Takae
 

Attachments

  • 1611765704532.png
    1611765704532.png
    54.5 KB · Views: 11
  • 1611765729538.png
    1611765729538.png
    34.7 KB · Views: 12
  • 1611765745876.png
    1611765745876.png
    29 KB · Views: 10
  • 1611765763774.png
    1611765763774.png
    31.4 KB · Views: 6
  • 1611765787170.png
    1611765787170.png
    27.4 KB · Views: 10
Upvote 0
Please try it.

VBA Code:
Sub test()
Dim Mws As Worksheet
Dim x(), ws
Dim LR As Long, i As Long, j As Long, cnt As Long, flg As Boolean

Set Mws = Sheets("M.A.")
Application.ScreenUpdating = False

With Mws
    LR = .Cells(Rows.Count, 1).End(xlUp).Row
    For i = 3 To LR
        If .Cells(i, 2).Value = "Yes" Then
           ReDim Preserve x(cnt)
           x(cnt) = .Cells(i, 2).Offset(0, -1).Value
           cnt = cnt + 1
        End If
    Next
    
    For i = 0 To UBound(x)
        For Each ws In Worksheets
            If ws.Name = x(i) Then
                flg = True
                Exit For
            End If
        Next
        If flg = False Then
            MsgBox x(i) & " Sheet Not Found"
            Exit Sub
        End If
        flg = False
    Next
    
    LR = .Cells(Rows.Count, 3).End(xlUp).Row
    For j = 0 To UBound(x)
        Sheets(x(j)).Range(Sheets(x(j)).Range("A8"), Sheets(x(j)).Range("A8").SpecialCells(xlLastCell).Offset(1, 0)).ClearContents
        For i = 3 + j To LR Step UBound(x) + 1
            .Range(.Cells(i, 3), .Cells(i, 5)).Copy Sheets(x(j)).Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
        Next
    Next

End With
Application.ScreenUpdating = True
MsgBox "Done"
End Sub
 
Upvote 0
Solution
Takae, Thank you, that works!

It keeps running the formula though, so it doesn't ever get to the msgbox Done. I have to hit Esc then when it stops all the account are where they need to be.

I apologize for not being clear enough the first time.

Thank you though for everything.
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,871
Members
449,054
Latest member
juliecooper255

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