Error 13 "No coinciden los tipos" Excel 2007 Visual Basic
publicado
Amigos, la siguiente macro se ejecuta perfectamente, pero al terminar de ejecutarse aparece Error 13 "No coinciden los tipos", no he podido encontrar la solución. Alguien me puede ayudar? (Ya probé instalando el Hotfix KB983246). Saludos......................................................................................................................................................................Sub Tramos()
Amigos, la siguiente macro se ejecuta perfectamente, pero al terminar de ejecutarse aparece Error 13 "No coinciden los tipos", no he podido encontrar la solución. Alguien me puede ayudar? (Ya probé instalando el Hotfix KB983246). Saludos......................................................................................................................................................................Sub Tramos()
'Borrar Datos Anteriores
'****************************************************
Range("L4:M175").Select
Selection.ClearContents
Range("L4").Select
'****************************************************
Dim m, j As Double
Dim p, n, u, r, t, k, w As Integer
w = Cells(1, 10)
r = 4
t = 5
Cells(r, 12) = Cells(r, 8)
Cells(r, 13) = Cells(r, 9)
For u = 1 To 100
j = Cells(r + 1, 8) - Cells(r, 8)
k = Fix(j / w)
If j > w Then
n = 1
For p = 1 To k
Cells(t, 12) = Cells(r, 8) + w * n
m = (Cells(r + 1, 9) - Cells(r, 9)) / (Cells(r + 1, 8) - Cells(r, 8))
Cells(t, 13) = m * w * n + Cells(r, 9)
n = n + 1
t = t + 1
Next p
Cells(t, 12) = Cells(r + 1, 8)
Cells(t, 13) = Cells(r + 1, 9)
t = t + 1
Else
Cells(t, 12) = Cells(r + 1, 8)
Cells(t, 13) = Cells(r + 1, 9)
t = t + 1
End If
r = r + 1
Next u
End Sub