PC Review


Reply
Thread Tools Rate Thread

Advanced Find & Replace

 
 
Hendrik.Kleine
Guest
Posts: n/a
 
      5th Jan 2009
Hi all, your help on this one would be greatly appreciated;

sheet1:

A B C
Name Date data

Sheet 2:

A B(date) C(date) etc...
Name1 data data
Name2 data data
etc..

I'm looking for a code that, when executed, will lookup NAME and DATE from
sheet1 in sheet2,
then replace the data on sheet 2 for the correct name and date with the data
from cell c on sheet1.

I'd be amazed if this were possible. Many thanks for trying!

Happy New Year,
Hendrik
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      5th Jan 2009
Sub marine()
Set s1 = Sheets("Sheet1")
Set s2 = Sheets("Sheet2")
s1.Activate
v1 = Range("A1").Value
v2 = Range("B1").Value
v3 = Range("C1").Value
s2.Activate
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = 1 To n
If Cells(i, 1).Value = v1 And Cells(i, 2).Value = v2 Then
Cells(i, 3).Value = v3
End If
Next
End Sub

So if Sheet1 has:

Joe 12/14/2008 123

and Sheet2 has:

Mike 12/24/2008
James 1/5/2009
Joe 12/13/2008
Joe 12/14/2008
Joe 12/15/2008
Fred 3/3/2002

then Sheet2 will be updated:

Mike 12/24/2008
James 1/5/2009
Joe 12/13/2008
Joe 12/14/2008 123
Joe 12/15/2008
Fred 3/3/2002

--
Gary''s Student - gsnu200823


"Hendrik.Kleine" wrote:

> Hi all, your help on this one would be greatly appreciated;
>
> sheet1:
>
> A B C
> Name Date data
>
> Sheet 2:
>
> A B(date) C(date) etc...
> Name1 data data
> Name2 data data
> etc..
>
> I'm looking for a code that, when executed, will lookup NAME and DATE from
> sheet1 in sheet2,
> then replace the data on sheet 2 for the correct name and date with the data
> from cell c on sheet1.
>
> I'd be amazed if this were possible. Many thanks for trying!
>
> Happy New Year,
> Hendrik

 
Reply With Quote
 
Hendrik Kleine
Guest
Posts: n/a
 
      6th Jan 2009
Thanks for your help. It's not exactly what I'm looking for though;

Sheet1 is fine, but,

on sheet2, the name is in column A, the dates are on row 7, horizontally,
not vertical. For example name1 is in cell A20 and the date is in cell K7.
The cell to modify would be K20.

Immensely appreciated if you could continue your advice.

Hendrik

"Gary''s Student" wrote:

> Sub marine()
> Set s1 = Sheets("Sheet1")
> Set s2 = Sheets("Sheet2")
> s1.Activate
> v1 = Range("A1").Value
> v2 = Range("B1").Value
> v3 = Range("C1").Value
> s2.Activate
> n = Cells(Rows.Count, "A").End(xlUp).Row
> For i = 1 To n
> If Cells(i, 1).Value = v1 And Cells(i, 2).Value = v2 Then
> Cells(i, 3).Value = v3
> End If
> Next
> End Sub
>
> So if Sheet1 has:
>
> Joe 12/14/2008 123
>
> and Sheet2 has:
>
> Mike 12/24/2008
> James 1/5/2009
> Joe 12/13/2008
> Joe 12/14/2008
> Joe 12/15/2008
> Fred 3/3/2002
>
> then Sheet2 will be updated:
>
> Mike 12/24/2008
> James 1/5/2009
> Joe 12/13/2008
> Joe 12/14/2008 123
> Joe 12/15/2008
> Fred 3/3/2002
>
> --
> Gary''s Student - gsnu200823
>
>
> "Hendrik.Kleine" wrote:
>
> > Hi all, your help on this one would be greatly appreciated;
> >
> > sheet1:
> >
> > A B C
> > Name Date data
> >
> > Sheet 2:
> >
> > A B(date) C(date) etc...
> > Name1 data data
> > Name2 data data
> > etc..
> >
> > I'm looking for a code that, when executed, will lookup NAME and DATE from
> > sheet1 in sheet2,
> > then replace the data on sheet 2 for the correct name and date with the data
> > from cell c on sheet1.
> >
> > I'd be amazed if this were possible. Many thanks for trying!
> >
> > Happy New Year,
> > Hendrik

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced Find and Replace avi Microsoft Excel Programming 0 15th Apr 2011 09:34 PM
Help w/ Advanced Find and Replace VirtuAllin Microsoft Excel Discussion 1 19th Feb 2010 01:13 PM
advanced find and replace help =?Utf-8?B?UkpX?= Microsoft Excel Worksheet Functions 1 30th Oct 2007 10:42 AM
Advanced Find and Replace Question Ryan Microsoft Excel Misc 3 6th Aug 2006 06:56 PM
Advanced find and replace? =?Utf-8?B?RGFu?= Microsoft Excel Misc 2 5th Mar 2004 04:51 PM


Features
 

Advertising
 

Newsgroups
 


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