Hola Andres, en tu Sub rpok() tu tienes la siguiente linea:
Dim d, t, R As Single
Con eso has definido R como Single, pero el resto están definidas como Variant(valor por defecto al no asignarlas tipo). Para solucionar esto solo define tus variables de la siguiente forma:
Dim d As Single, t As Single, R As Single
Con eso ya debería de funcionar. No se si @hugoivanvrtenga algún otro comentario que agregar.
Please note:
This action will also remove this member from your connections and send a report to the site admin.
Please allow a few minutes for this process to complete.