Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Advanced Find & Replace

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

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Advanced Find & Replace

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Advanced Find & Replace

Hi,

You can easily get sheet2 using pivot table. Put the names to row, dates to
column and "Sum of data" to values.


Hendrik Kleine wrote:
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

Sub marine()
Set s1 = Sheets("Sheet1")

[quoted text clipped - 57 lines]
Happy New Year,
Hendrik


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
advanced find and replace help RJW Excel Worksheet Functions 1 October 30th 07 10:42 AM
Advanced Find and replace [email protected] Links and Linking in Excel 0 February 23rd 07 07:29 AM
Advanced Find and Replace Question Ryan Excel Discussion (Misc queries) 3 August 6th 06 06:56 PM
Advanced Find and Replace Question Ryan Excel Worksheet Functions 1 August 5th 06 03:58 PM
advanced macro for find replace kauseway[_4_] Excel Programming 0 October 8th 04 11:24 PM


All times are GMT +1. The time now is 09:37 AM.

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

About Us

"It's about Microsoft Excel"