Forum Discussion
I need help with this code
- Aug 02, 2023
Use the following code
Dim pagina As Long
On Error GoTo ErrHndlr
pagina = InputBox("Introduce el número de la página", "Buscador de páginas", pagina)
Selection.GoTo wdGoToPage, wdGoToAbsolute, pagina
ErrHndlr:
If Err.Number = 13 Then
MsgBox "You cancelled the process"
Exit Sub
End IfThe MsgBox "You cancelled the process" command is optional and can be omitted if you do not want it to appear.
Use the following code
Dim pagina As Long
On Error GoTo ErrHndlr
pagina = InputBox("Introduce el número de la página", "Buscador de páginas", pagina)
Selection.GoTo wdGoToPage, wdGoToAbsolute, pagina
ErrHndlr:
If Err.Number = 13 Then
MsgBox "You cancelled the process"
Exit Sub
End If
The MsgBox "You cancelled the process" command is optional and can be omitted if you do not want it to appear.
Thanks for your help, it works like a charm.
ColdGeorge