William_Mejia
New member
- Joined
- Jul 3, 2019
- Messages
- 2
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- 2016
Can someone explain me why the error 13 is occurring. It is something with the line: x(r, c) = x(r, c) * 2
I appreciate your help!
Code:
Sub RangeToVariant2()
Dim UserRange As Range
Dim x As Variant
Dim r As Long, c As Integer
Set UserRange = Range("A1:L600")
x = Range("A1:L50")
For r = 1 To UBound(x, 1)
For c = 1 To UBound(x, 2)
'Multiplicar por 2
x(r, c) = x(r, c) * 2
Next c
Next r
Range("A1:L50") = x
End Sub
I appreciate your help!
Last edited by a moderator: