I am currently doing a project on VBA. When implementing loop I encountered problems as my formulas do not work. If anyone could help me I would really appreciate it. It was supposed to count number of days from order till shipment date and then creating a loop to show as many results as the filter does. The macro will be assigned to a new button so basically it will not have any connections with filtering. I believe that the issue lays in loop.
Sub DateDiff_Day()
Range("O8").Select
Do Until ActiveCell.Value = " "
Dim datValue1 As Date
Dim datValue2 As Date
datValue1 = Worksheets("Adv.filter, Pivot, Chart").Range("F8")
datValue2 = Worksheets("Adv.filter, Pivot, Chart").Range("H8")
CopyToRAnge: Worksheets("Adv.filter, Pivot, Chart").Range("O8") = DateDiff("d", datValue1, datValue2)
Loop
End Sub