Hola @RubenDario
Faltaría que en cada línea dentro del With le pongas un punto al inicio
With Hoja1
.Range("B6:B18,F6:F18,J6:J18").Select
.Range("J6").Activate
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
.Selection.ClearContents
.Range("A1").Select
End With
Sin embargo, lo que yo haría (si fuese mi proyecto)... te ofrezco varias soluciones.
No asignarlo a una combinación de teclas, mejor ponerlo en una forma o botón.
Modificar tu libro con la app Custom UI Editor o similar y adicionar un botón en el Ribbon, estará visible solo cuando el libro esté activo.
Al principio de tu código pondría algo como: If Thisworkbook.Name <> ActiveWorkbook.Name Then Exit sub
Por
DiegoPC, · publicado
Buenas noches,
Estoy intentando utilizar esta macro pero no me responde y desconozco porqué.
Además el navegador que uso suele ser chrome. ¿Alguien puede ayudarme a saber porque no se ejecuta bien?
Gracias
adjunto código
---
Sub scrapeHyperlinksWebsite()
Dim ie As InternetExplorer
Dim html As HTMLDocument
Dim Link As Object
Dim ElementCol As Object
Dim erow As Long
Application.ScreenUpdating = False
Set ie = New InternetExplorer
ie.Visible = False
‘ie.navigate “http://www.rondebruin.nl/contact.htm”
‘ie.navigate “http://info.mathxlforschool.com/contact-us”
ie.navigate “http://www.iberia.es”
Do While ie.readyState <> READYSTATE_COMPLETE
Application.StatusBar = “Loading website…”
DoEvents
Loop
Set html = ie.document
‘Range(“A2″) = html.DocumentElement.innerHTML
Set ElementCol = html.getElementsByTagName(“a”)
‘Set ElementCol = html.getElementsByTagName(“mailto:”)
For Each Link In ElementCol
If InStr(Link, “mailto:”) Then
erow = Worksheets(“Sheet1″).Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(erow, 1).Value = Link
Cells(erow, 1) = Right(Link, Len(Link) – InStr(Link, “:”))Cells(erow, 1).Columns.AutoFit
End If
Next
Set ie = Nothing
Application.StatusBar = “”
Application.ScreenUpdating = True
End Sub