I'm struggling with a piece of code I'm working on.
I want to loop through each cell of one table and compare their column headers (text) and row headers (dates) with the contents of another table.
Currently my code looks like this:
Any help and suggestions are much appreciated!![]()
Sub test() Dim cDummy As Object Dim rvDummy As Date Dim cvDummy As Long Dim c1Historik As Object Dim c2Historik As Date For Each cDummy In Range("rDummy") rvDummy = Range(cDummy).End(xlToLeft).Value 'Here is my break-point cvDummy = Range(cDummy).End(xlUp).Value For Each c1Historik In Range("Historik_start") c2Historik = Range(c1Historik).Offset(0, 1).Value If Range(c1Historik).Offset(0, -1).Value = cvDummy Then If c1Historik.Value <= rvDummy And c2Historik >= rvDummy Then cDummy = 3 End If End If Next c1Historik Next cDummy End Sub
Bookmarks