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: 32
  • TMs Tab.jpg
    TMs Tab.jpg
    46.3 KB · Views: 32

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
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: 9
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: 14
  • 1611765729538.png
    1611765729538.png
    34.7 KB · Views: 15
  • 1611765745876.png
    1611765745876.png
    29 KB · Views: 14
  • 1611765763774.png
    1611765763774.png
    31.4 KB · Views: 9
  • 1611765787170.png
    1611765787170.png
    27.4 KB · Views: 13
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,223,886
Messages
6,175,190
Members
452,616
Latest member
intern444

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