I'm making a simple subtraction between two cells that contain dates in order to obtain the period. Every client, in Data_p worksheet, Range ("4"), will have all the order dates in the respective column. So the subtraction will be between the second date and the first, and so on, and the result will be pasted in Data_p_mgnt. This function will have to be executed until there're no more dates for each client.
I have the following code, but I don't know why it won't stop when it finds and Empty cell in Data_p. Any insight will be appreciated.
Sub Prueba_Data_p_mgnt()
Sheets("Data_p_mgnt").Select
Range("B5").Select 'Starts in cell B5
Do Until IsEmpty(Worksheets("Data_p").Range("B5")) 'Checks if cells in Data_p are Empty or Blank
ActiveCell.FormulaR1C1 = "=Data_p!R[1]C-Data_p!RC" 'Makes the subtraction between cells
ActiveCell.Offset(1, 0).Range("A1").Select 'Moves down for paste the next period
Loop 'Loop until there's an Empty cell in Data_p
'Then should move to next client to the right and repeat until there are no more clients in row 4
End Sub