SeanKC1989
New Member
- Joined
- Oct 9, 2018
- Messages
- 13
Hey guys and girls,
I have managed to create a macro to pull data from a website but the format of the data is not correct at all.
What I need to do is add a few lines that will search column A for data, If column A has no data for that row then it can be assumed to be data related to the row above.
I have attached an example that should show what I mean but any clarification required then just ask.
Any help is appreciated, thanks guys
Below is the currently used Macro in VBA
Sub getetrackerdata()
'
' getetrackerdata Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;"
, Destination:=Range("$A$1"))
.CommandType = 0
.Name = _
"iss_predefined_reports.asp?Tab=reports&ProjectID=SVOIATF&ReportID=1424530&public_report=Y_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "13"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll ToRight:=0
ActiveWindow.SmallScroll Down:=-345
Rows("2:5").Select
End Sub
Won't let me upload anything for some reason so here goes with creating table here
[TABLE="width: 500"]
<tbody>[TR]
[TD]Header 1[/TD]
[TD]Header 2[/TD]
[TD]Header 3[/TD]
[TD]Header 4[/TD]
[TD]Header 5[/TD]
[TD]6[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]asd[/TD]
[TD]sdas[/TD]
[TD]asd[/TD]
[TD]asd[/TD]
[TD]sdas[/TD]
[TD]da[/TD]
[TD]sdas[/TD]
[TD]d[/TD]
[TD]sad[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]sda[/TD]
[TD][/TD]
[TD]sd[/TD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[TD][/TD]
[TD]s[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]s[/TD]
[TD]s[/TD]
[TD]d[/TD]
[TD]as[/TD]
[TD]dsa[/TD]
[TD][/TD]
[TD]s[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
If column A (the number) has data, I would like the whole row to be included in that table row, if column A has no data then I would like the whole row to be included with the previous Row of data
I have managed to create a macro to pull data from a website but the format of the data is not correct at all.
What I need to do is add a few lines that will search column A for data, If column A has no data for that row then it can be assumed to be data related to the row above.
I have attached an example that should show what I mean but any clarification required then just ask.
Any help is appreciated, thanks guys
Below is the currently used Macro in VBA
Sub getetrackerdata()
'
' getetrackerdata Macro
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;"
, Destination:=Range("$A$1"))
.CommandType = 0
.Name = _
"iss_predefined_reports.asp?Tab=reports&ProjectID=SVOIATF&ReportID=1424530&public_report=Y_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "13"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll ToRight:=0
ActiveWindow.SmallScroll Down:=-345
Rows("2:5").Select
End Sub
Won't let me upload anything for some reason so here goes with creating table here
[TABLE="width: 500"]
<tbody>[TR]
[TD]Header 1[/TD]
[TD]Header 2[/TD]
[TD]Header 3[/TD]
[TD]Header 4[/TD]
[TD]Header 5[/TD]
[TD]6[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]1[/TD]
[T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]
[TD]as[/TD]
[TD]d[/TD]
[TD]asd[/TD]
[TD]as[/TD]
[TD]s[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]ss[/TD]
[TD]s[/TD]
[TD][/TD]
[TD]sd[/TD]
[TD]sa[/TD]
[TD]d[/TD]
[TD]sasa[/TD]
[TD][/TD]
[TD]s[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]s[/TD]
[TD]s[/TD]
[TD]d[/TD]
[TD]as[/TD]
[TD]dsa[/TD]
[TD][/TD]
[TD]s[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
If column A (the number) has data, I would like the whole row to be included in that table row, if column A has no data then I would like the whole row to be included with the previous Row of data