Automatic updates to other sheets from master sheet

Joined
May 17, 2012
Messages
1
Reaction score
0
I would like to work in a code that will automatically update my worksheets. This is the code that I have now.

Sub test()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = 2 To LR
If Range("B" & i).Value = "AP" Then Rows(i).Copy Destination:=Sheets("AP").Range("A" & Rows.Count).End(xlUp).Offset(1)
If Range("B" & i).Value = "*AP" Then Rows(i).Copy Destination:=Sheets(" If Range("B" & i).Value = "CSW" Then Rows(i).Copy Destination:=Sheets("CSW").Range("A" & Rows.Count).End(xlUp).Offset(1)
If Range("B" & i).Value = "CO" Then Rows(i).Copy Destination:=Sheets("CO").Range("A" & Rows.Count).End(xlUp).Offset(1)
If Range("B" & i).Value = "PSR" Then Rows(i).Copy Destination:=Sheets("PSR").Range("A" & Rows.Count).End(xlUp).Offset(1)
Next i
End Sub

The code separates the data into the other sheets, but it doesn't update it automatically. Is there a code that automatically updates the other sheets right after I input the new data? Like after I press enter and move to the next row?
 
Joined
Dec 31, 2012
Messages
3
Reaction score
0
This may help, in this particular file I have things update when I activate a sheet.

Private Sub Worksheet_Activate()
With ActiveSheet
Range("B3:BA15").Dirty
Range("B19:BA32").Dirty
Range("B36:BA49").Dirty
Range("B53:BA66").Dirty
.Calculate
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top