Copying data from one data sheet to another automatically excel

Closed
arropes Posts 2 Registration date Thursday September 11, 2014 Status Member Last seen September 12, 2014 - Sep 11, 2014 at 08:39 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Sep 13, 2014 at 05:40 AM
Dear Excel Gurus,
What I want excel to do is, if a name put in a certain category on sheet one, then it automatically get copied into another sheet with the names of only the people in that category

E.g.
sheet 1
Name Category
John Doe1 - green
John doe2 - green
John doe3 - yellow
John doe4 - red

Sheet2 (green)
John Doe1
John doe2

Sheet 3 (yellow)
John doe3

Sheet 4 (red)
John doe4

Can anyone help me here??

Thanks in advance
Related:

2 responses

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Sep 12, 2014 at 02:03 AM
better to already open sheets. sheet2 may be namead green sheet2 yellow etc
type name category in shee1 A1 and B1 then:

KEEP YOUR ORIGINAL FILE SAFELY SOMEWHERE FOR RETRIEVAL IF SOMETHING GOES WRONG

right clicl tab of sheet1 and click view code
in the window that opens copy this event code

Private Sub Worksheet_Change(ByVal Target As Range)
Dim clr As String
If Target.Column <> 2 Then Exit Sub
Application.EnableEvents = False
clr = Target
Target.Offset(0, -1).Copy
With Worksheets(clr)
.Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial
End With
Application.EnableEvents = True
End Sub

save the fiel as macro enabled file

now go to sheet 1 type the name in col A and then type the color of the sheet in the corresponding col. B and see whether the name is copied in the relevant sheet

change modify the code if necessary.
0
arropes Posts 2 Registration date Thursday September 11, 2014 Status Member Last seen September 12, 2014
Sep 12, 2014 at 09:15 AM
Thanks for responding venkat1926

When i right click the tab of sheet one Im not seeing "view code"

Thanks again
0
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Sep 13, 2014 at 05:40 AM
when you right click tab of sheet1( tab is the name sheet1 at the bottom of any sheet) you will get following


insert
delete
rename
move or copy
view code
etc
0