Excel 2007 timeline, help please
Solved/Closed
Orkt
Posts
6
Registration date
Friday May 29, 2009
Status
Member
Last seen
June 22, 2009
-
May 30, 2009 at 10:29 PM
Orkt Posts 6 Registration date Friday May 29, 2009 Status Member Last seen June 22, 2009 - Jun 22, 2009 at 05:11 PM
Orkt Posts 6 Registration date Friday May 29, 2009 Status Member Last seen June 22, 2009 - Jun 22, 2009 at 05:11 PM
Related:
- Excel 2007 timeline, help please
- Save as pdf office 2007 - Download - Other
- Excel marksheet - Guide
- Number to words in excel - Guide
- Excel apk for pc - Download - Spreadsheets
- Hi5 profile 2007 - Guide
1 response
Orkt
Posts
6
Registration date
Friday May 29, 2009
Status
Member
Last seen
June 22, 2009
1
Jun 22, 2009 at 05:11 PM
Jun 22, 2009 at 05:11 PM
Sub ABC()
Dim sh1 As Worksheet, sh2 As Worksheet
Dim r1Date As Range, r2Date As Range
Dim r1Name As Range, r2Name As Range
Dim cell As Range, cell1 As Range, Cell2 As Range Set sh1 = Worksheets("Sheet1") Set sh2 = Worksheets("Sheet2") Set r1Date = sh1.Range(sh1.Cells(1, 2), sh1.Cells(1, Columns.Count).End(xlToLeft)) Set r1Name = sh1.Range(sh1.Cells(2, 1), sh1.Cells(Rows.Count, 1).End(xlUp))
Set r2Date = sh2.Range(sh2.Cells(1, 2), sh2.Cells(Rows.Count, 2).End(xlUp)) Set r2Name = r2Date.Offset(0, -1)
For Each cell In r1Date
For Each cell1 In r1Name
For Each Cell2 In r2Date
If cell = Cell2 Then
If Cell2.Offset(0, -1) = cell1 Then
sh1.Cells(cell1.Row, cell.Column).Value = Cell2.Offset(0, 1).Value
Exit For
End If
End If
Next Cell2
Next cell1
Next cell
End Sub
Dim sh1 As Worksheet, sh2 As Worksheet
Dim r1Date As Range, r2Date As Range
Dim r1Name As Range, r2Name As Range
Dim cell As Range, cell1 As Range, Cell2 As Range Set sh1 = Worksheets("Sheet1") Set sh2 = Worksheets("Sheet2") Set r1Date = sh1.Range(sh1.Cells(1, 2), sh1.Cells(1, Columns.Count).End(xlToLeft)) Set r1Name = sh1.Range(sh1.Cells(2, 1), sh1.Cells(Rows.Count, 1).End(xlUp))
Set r2Date = sh2.Range(sh2.Cells(1, 2), sh2.Cells(Rows.Count, 2).End(xlUp)) Set r2Name = r2Date.Offset(0, -1)
For Each cell In r1Date
For Each cell1 In r1Name
For Each Cell2 In r2Date
If cell = Cell2 Then
If Cell2.Offset(0, -1) = cell1 Then
sh1.Cells(cell1.Row, cell.Column).Value = Cell2.Offset(0, 1).Value
Exit For
End If
End If
Next Cell2
Next cell1
Next cell
End Sub