#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update data linked between worksheets when resorting data JayStar Excel Discussion (Misc queries) 0 July 16th 07 11:06 AM
update a Pivot Table with new data added to the base data Graham Y Excel Discussion (Misc queries) 1 March 19th 07 02:12 PM
how to update data displayed from a UDF when the source data chang JMC New Users to Excel 2 September 9th 06 01:38 AM
data update Zulu Excel Discussion (Misc queries) 2 August 5th 06 08:57 AM
Update a chart immediately after inputting data into data source MELMEL Charts and Charting in Excel 1 December 1st 05 09:34 PM


All times are GMT +1. The time now is 02:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"