Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
advanced find and replace help | Excel Worksheet Functions | |||
Advanced Find and replace | Links and Linking in Excel | |||
Advanced Find and Replace Question | Excel Discussion (Misc queries) | |||
Advanced Find and Replace Question | Excel Worksheet Functions | |||
advanced macro for find replace | Excel Programming |