Update Data

  • Thread starter Thread starter Abdul Shakeel
  • Start date Start date
A

Abdul Shakeel

Hi All,

I have a sheet with Column heads
Date Invoice Number Amount
I want that in column 4 in any row I have write Paid so this Particualr row
Update with all of its contents on Sheet 2
 
Try this event macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set r = Range("D:D")
If Intersect(t, r) Is Nothing Then Exit Sub
If t.Value <> "Paid" Then Exit Sub
Set w1 = Sheets("Sheet1")
Set w2 = Sheets("Sheet2")
Set r1 = Range("A" & t.Row & ":D" & t.Row)
Application.EnableEvents = False
n = w2.Cells(Rows.Count, 1).End(xlUp).Row + 1
r1.Copy
w2.Activate
w2.Cells(n, 1).Select
ActiveSheet.Paste
w1.Activate
Application.EnableEvents = True
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

Back
Top