Auto-copying to separate sheets

rjustanik

New Member
Joined
Apr 21, 2016
Messages
2
We have an online form that populates to an Excel spreadsheet. We would like the rows to automatically copy to separate sheets (tabs) based on the information in column A. Column A will be co-workers' names and the sheets will allow them to view only their accounts in their own sheet (tab). Can someone help with that?

Thanks!!!
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hello Rjustanik,

The following code placed in a standard module should do the task for you:-


Code:
Sub TransferData()

Application.ScreenUpdating = False

            Dim lr As Long
            Dim MySheet As String
            Dim cell As Range

lr = Range("A" & Rows.Count).End(xlUp).Row

For Each cell In Range("A2:A" & lr)
            MySheet = cell.Value
            cell.EntireRow.Copy Sheets(MySheet).Range("A" & Rows.Count).End(3)(2)
Next cell

MsgBox "Data transfer completed."

Application.CutCopyMode = False
Application.ScreenUpdating = True

End Sub

Following is the link to my test work book for you to peruse. Click on the button to see the code at work:-

https://www.dropbox.com/s/74kkbahbtpg9cpb/Rjustanik(Master sheet to multi sheets).xlsm?dl=0

I'm not sure if you would like the "used" data in sheet1 (or your Input sheet) cleared once transferred to each individual sheet or if the online form overwrites previous data. Please advise.

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
For some reason it wouldn't run the marco on my computer but I'm sure its just my computer. We do what a main page with all of the information in one place. Does this one do that? Thanks so much!!!!!

Hello Rjustanik,

The following code placed in a standard module should do the task for you:-


Code:
Sub TransferData()

Application.ScreenUpdating = False

            Dim lr As Long
            Dim MySheet As String
            Dim cell As Range

lr = Range("A" & Rows.Count).End(xlUp).Row

For Each cell In Range("A2:A" & lr)
            MySheet = cell.Value
            cell.EntireRow.Copy Sheets(MySheet).Range("A" & Rows.Count).End(3)(2)
Next cell

MsgBox "Data transfer completed."

Application.CutCopyMode = False
Application.ScreenUpdating = True

End Sub

Following is the link to my test work book for you to peruse. Click on the button to see the code at work:-

https://www.dropbox.com/s/74kkbahbtpg9cpb/Rjustanik(Master sheet to multi sheets).xlsm?dl=0

I'm not sure if you would like the "used" data in sheet1 (or your Input sheet) cleared once transferred to each individual sheet or if the online form overwrites previous data. Please advise.

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
Hello Rjustanik,

Does this one do that?

If you were able to access my test work book, you'll see that the code will search Column A in the Input sheet (sheet1 in this case) for each individual worker's name and then take the relevant row of data associated with that name and transfer the data to the individual sheet. This will happen once sheet1 has been populated from the external source and you run the code.

If you believe that your computer is the problem, see if you can access another PC and then try again on it.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,215,193
Messages
6,123,566
Members
449,108
Latest member
rache47

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