henriquehoffmann
24-01-2017 19:12:26
Boa tarde, estou com um problema para copiar os dados da web de um fórum de game online e preciso de um auxílio.
Agradeço já a disposição do fórum para me ajudar.
Segue minha macro:
Sub Macro1()
Dim segundo As Integer
segundo = InputBox("Digite o segundo valor:", "Não esqueça o anterior")
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://forum.lhgenericname01.lc/index. ... begins&st=" & segundo, Destination:=Range("$A$1"))
.Name = _
"?sort_key=members_l_display_name&sort_order=asc&max_results=60&name_box=begins&st=00"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Rows("1:99").Delete
Rows("541:609").Delete
End Sub
Segue o problema:
A próxima página seria:
https://forum.lhgenericname01.lc/index. ... =[b][u]120[/u][/b]
Agradeço já a disposição do fórum para me ajudar.
Segue minha macro:
Sub Macro1()
Dim segundo As Integer
segundo = InputBox("Digite o segundo valor:", "Não esqueça o anterior")
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://forum.lhgenericname01.lc/index. ... begins&st=" & segundo, Destination:=Range("$A$1"))
.Name = _
"?sort_key=members_l_display_name&sort_order=asc&max_results=60&name_box=begins&st=00"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Rows("1:99").Delete
Rows("541:609").Delete
End Sub
Segue o problema:
- No fórum tem 72 páginas com 60 usuários por página, preciso que o código retorne apenas o nome do usuário e não tudo que vem junto;
- É preciso login e senha do fórum, que eu tenho, mas não sei se a macro conseguirá fazer sem eu colocar login e senha;
- Quero salvar os nomes de usuários em uma nova planilha;
- Alguns usuários que inciam com a o número 0 o excel remove o número 0, porém é essencial o nome completo do usuário;
- O inteiro definido como segundo eu precisei colocar para atualizar manualmente o número da página, porque o link do fórum altera apenas a ultima numeração, de 60 em 60, por exemplo:
A próxima página seria:
https://forum.lhgenericname01.lc/index. ... =[b][u]120[/u][/b]