:( NOOOOOOOOOOOOO!!! :(Código: Text
Private Function Desplazar(Valor As Integer, Direccion As String, nBits As Integer) As Integer Dim i As Integer If Not 0 < nBits < 16 Then Err.Raise 1001, , "Número de bits a desplazar incorrecto" Desplazar = Valor If Direccion = "izq" Then 'Desplazamiento a la izquierda For i = 1 To nBits Desplazar = Desplazar * 2 Next i ElseIf Direccion = "dch" Then 'Desplazamiento a la derecha For i = 1 To nBits Desplazar = Desplazar \ 2 Next i End If End Function