Excel 2007 timeline, help please
Solved/Closed
Orkt
Posts
6
Registration date
Friday 29 May 2009
Status
Member
Last seen
22 June 2009
-
30 May 2009 à 22:29
Orkt Posts 6 Registration date Friday 29 May 2009 Status Member Last seen 22 June 2009 - 22 Jun 2009 à 17:11
Orkt Posts 6 Registration date Friday 29 May 2009 Status Member Last seen 22 June 2009 - 22 Jun 2009 à 17:11
Related:
- Excel 2007 timeline, help please
- Save as pdf office 2007 - Download - Other
- Windows timeline - Guide
- Microsoft picture manager download 2007 - Download - Image viewing and management
- Excel mod apk for pc - Download - Spreadsheets
- Vat calculation excel - Guide
1 response
Orkt
Posts
6
Registration date
Friday 29 May 2009
Status
Member
Last seen
22 June 2009
1
22 Jun 2009 à 17:11
22 Jun 2009 à 17:11
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