chicago60614
New Member
- Joined
- Jun 9, 2011
- Messages
- 1
I have used the macro below to pull information from a website and then paste the information into specific cells in excel. This has worked for almost 1 year. Excel would open the webpage into excel (i.e. bring in data, pictures, etc) via "Workbooks.Open Filename:=webpage" I will then pull the data from the specific cells. Over the last day or so, excel has stopped bringing in the information as a webpage and now opens it as website code. It converts the webpage into text via the text wizard. I'm confused why this changed and it may not even be an issue with the macro below. Maybe its a setting in excel. Any help would be appreciated.
Sub TEST()
Dim webpage As String
Application.ScreenUpdating = False
For x = 2 To 100 Step 1
For y = 1 To 248 Step 1
webpage = Worksheets("Input").Cells(x, y).Value
Workbooks.Open Filename:=webpage
Cells(90, 9).Value = "=A100"
Range("I90").Select
Selection.AutoFill Destination:=Range("I90:I120"), Type:=xlFillDefault
Range("I90:I120").Select
Selection.Copy
Windows("Suburb Data Set.xls").Activate
Sheets("Placeholder").Activate
Range("B1:B10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("o31").Select
Selection.Copy
Sheets("Input").Select
Cells(x, y).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Placeholder").Select
Range("B1:B31").Select
Selection.ClearContents
Windows("maps").Activate
Application.DisplayAlerts = False
ActiveWindow.Close
Application.DisplayAlerts = True
Next y
Next x
Done:
Sheets("Input").Activate
Application.ScreenUpdating = True
End Sub
Sub TEST()
Dim webpage As String
Application.ScreenUpdating = False
For x = 2 To 100 Step 1
For y = 1 To 248 Step 1
webpage = Worksheets("Input").Cells(x, y).Value
Workbooks.Open Filename:=webpage
Cells(90, 9).Value = "=A100"
Range("I90").Select
Selection.AutoFill Destination:=Range("I90:I120"), Type:=xlFillDefault
Range("I90:I120").Select
Selection.Copy
Windows("Suburb Data Set.xls").Activate
Sheets("Placeholder").Activate
Range("B1:B10").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("o31").Select
Selection.Copy
Sheets("Input").Select
Cells(x, y).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Sheets("Placeholder").Select
Range("B1:B31").Select
Selection.ClearContents
Windows("maps").Activate
Application.DisplayAlerts = False
ActiveWindow.Close
Application.DisplayAlerts = True
Next y
Next x
Done:
Sheets("Input").Activate
Application.ScreenUpdating = True
End Sub