|
▼かみちゃん さん:
アドバイスありがとうございました。
Sub uma2()
Sheets("競争馬リスト").Select
Range("a1").Select
Set st = ActiveSheet
For I = 1 To 18
If Sheets("競争馬リスト").Cells(I, 2).Value = "" Then Exit For
ActiveWorkbook.Worksheets.Add.Name = st.Range("A" & I)
ActiveCell.FormulaR1C1 = Sheets("競争馬リスト").Cells(I, 2).Value
uma01 = Range("a1").Value
Dim strURL As String
Dim FR As Range
strURL = uma01
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & strURL, Destination:=Range("A1"))
.Name = "uma"
.AdjustColumnWidth = False
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.Refresh BackgroundQuery:=False
End With
Set FR = Columns("A").Find("プロフィール*", , , xlWhole)
If Not FR Is Nothing Then
If FR.Row > 4 Then
Range("A1", FR.Offset(-4)).EntireRow.Delete xlShiftUp
Range("B1").Resize(, Columns.Count - 1).Delete xlShiftToLeft
End If
End If
Set FR = Columns("A").Find("日付", , , xlWhole)
If Not FR Is Nothing Then
Range("A2", FR.Offset(-1)).EntireRow.Delete xlShiftUp
End If
Set FR = Columns("A").Find("競馬DBトップ", , , xlWhole)
If Not FR Is Nothing Then
Range(FR.Offset(-2), Cells(Rows.Count, "A").End(xlUp)).EntireRow.Delete xlShiftUp
End If
Next
End Sub
で解決できました。
ありがとうございます。
|
|