pepe90
07-26-2011, 09:10 AM
Hello, the problem I have is that running a macro I made on Excel 2003 on the 2007 version it demands all variables declarations, so I did it, but now it shows an error on the Str function. Here is the code:
Public Sub reporte(ByRef maquinas() As String, ByRef cantidad_maquinas() As Double)
Dim n, fila, i, j, maqs_encontradas As Integer
n = UBound(maquinas)
fila = 1
For i = 0 To n
maqs_encontradas = 0
With Sheets("REPORTE")
.Cells(fila, 1) = Str(cantidad_maquinas(i)) & " " & maquinas(i)
.Cells(fila + 1, 1) = "MÁQUINA"
.Cells(fila + 1, 2) = "PLACA"
.Cells(fila + 1, 3) = "UBICACIÓN"
.Cells(fila + 1, 4) = "ESTADO"
End With
Next
end sub
It marks "Str" and says that doesn't find the proyect or library.
Thanks in advance
Public Sub reporte(ByRef maquinas() As String, ByRef cantidad_maquinas() As Double)
Dim n, fila, i, j, maqs_encontradas As Integer
n = UBound(maquinas)
fila = 1
For i = 0 To n
maqs_encontradas = 0
With Sheets("REPORTE")
.Cells(fila, 1) = Str(cantidad_maquinas(i)) & " " & maquinas(i)
.Cells(fila + 1, 1) = "MÁQUINA"
.Cells(fila + 1, 2) = "PLACA"
.Cells(fila + 1, 3) = "UBICACIÓN"
.Cells(fila + 1, 4) = "ESTADO"
End With
Next
end sub
It marks "Str" and says that doesn't find the proyect or library.
Thanks in advance