Code:
Option Explicit
Sub RiteData()
Dim wkSht As Worksheet
Dim nextRow As Long
Dim lRow As Long
Dim i As Integer
Dim celltxt As String
lRow = Sheets("Main").Cells(Rows.Count, "B").End(xlUp).Row
Application.ScreenUpdating = False
For Each wkSht In Sheets
Sheets("Main").Activate
For i = 2 To lRow
celltxt = Sheets("Main").Range("B" & i)
If Sheets("Main").Range("A" & i).Value = wkSht.Name Then
Sheets("Main").Activate
wkSht.Activate
nextRow = wkSht.Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Main").Range("B" & i).Copy Destination:=wkSht.Range("A" & nextRow)
Sheets("Main").Range("B" & i) = ""
End If
Next i
Next wkSht
Sheets("Main").Activate
Sheets("Main").Range("A1").Select
Application.ScreenUpdating = True
End Sub