ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Update Data (https://www.excelbanter.com/excel-discussion-misc-queries/180937-update-data.html)

Abdul Shakeel

Update Data
 
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


Gary''s Student

Update Data
 
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
--
Gary''s Student - gsnu200775


"Abdul Shakeel" wrote:

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


Abdul Shakeel

Update Data
 
Dear Gary,

Your code is mind blowing thanks for this.

"Gary''s Student" wrote:

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
--
Gary''s Student - gsnu200775


"Abdul Shakeel" wrote:

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



All times are GMT +1. The time now is 10:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com