You are on page 1of 4

Macros excel

Sub Macro1()

'Trasladar datos de la hoja actual a otra

Range("B1:B4").Copy

v1 = "Hoja" & ActiveCell.Row

'MsgBox v1

Application.Goto (ActiveWorkbook.Sheets(v1).Range("A1"))

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

:=False, Transpose:=False

Application.CutCopyMode = False

End Sub

Function NumAscii(letra As String) As Integer

NumAscii = Val(Asc(letra))

End Function

Function Simbolo(numero As Integer) As String

Simbolo = Chr(numero)

End Function

Function Num(letra As String) As Integer

Num = Val(Asc(letra)) - 33

End Function

Function Simb(numero As Integer) As String

Simb = Chr(numero + 33)

End Function
Sub CarNum()

V = ActiveCell.Value

L = Len(V)

If L > 0 Then

For i = 1 To L

T = Mid(V, i, 1)

W = Val(Asc(T)) - 33

MsgBox (W)

Next i

End If

End Sub

Sub NumCar()

L = Val(InputBox("Numero de Caracteres "))

T = ""

If L > 0 Then

For i = 1 To L

V = -1

Do Until V >= 0 And V <= 99

V = InputBox("teclee un numero entre 0 y 99")

Loop

T = T + Chr(V + 33)

Next i

ActiveCell.Value = T

End If

End Sub
33 ! 0 74 J 41
34 " 1 75 K 42
35 # 2 76 L 43
36 $ 3 77 M 44
37 % 4 78 N 45
38 & 5 79 O 46
39 ' 6 80 P 47
40 ( 7 81 Q 48
41 ) 8 82 R 49
42 * 9 83 S 50
43 + 10 84 T 51
44 , 11 85 U 52
45 - 12 86 V 53
46 . 13 87 W 54
47 / 14 88 X 55
48 0 15 89 Y 56
49 1 16 90 Z 57
50 2 17 91 [ 58
51 3 18 92 \ 59
52 4 19 93 ] 60
53 5 20 94 ^ 61
54 6 21 95 _ 62
55 7 22 96 ` 63
56 8 23 97 a 64
57 9 24 98 b 65
58 : 25 99 c 66
59 ; 26 100 d 67
60 < 27 101 e 68
61 = 28 102 f 69
62 > 29 103 g 70
63 ? 30 104 h 71
64 @ 31 105 i 72
65 A 32 106 j 73
66 B 33 107 k 74
67 C 34 108 l 75
68 D 35 109 m 76
69 E 36 110 n 77
70 F 37 111 o 78
71 G 38 112 p 79
72 H 39 113 q 80
73 I 40 114 r 81
115 s 82 126 ~ 93
116 t 83 127 • 94
117 u 84 128 € 95
118 v 85 129 • 96
119 w 86 130 ‚ 97
120 x 87 131 ƒ 98
121 y 88 132 „ 99
122 z 89
123 { 90 Fin Celda ° 176
124 | 91 Nombr C ¬ 172
125 } 92 Extra ¿ 191

You might also like