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
<tbody>
</tbody>
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
Header 1 | Header 2 | Header 3 | Header 4 | Header 5 | 6 | 7 | 8 | 9 | 10 |
1 | asd | sdas | asd | asd | sdas | da | sdas | d | sad |
sda | sd | asda | sad | ||||||
2 | s | ad | sd | sd | |||||
sda | sdasd | asdas | d | sad | |||||
3 | sd | sadasd | sadasd | asda | s | asdasd | as | ss | |
4 | sd | sa | das | d | as | asd | as | sd | s |
5 | sd | a | sd | as | d | as | da | s | s |
sd | asda | sda | sda | sdasd | sd | s | sd | ||
6 | as | a | sf | sdf | as | d | asd | as | s |
ss | s | sd | sa | d | sasa | s | |||
s | s | d | as | dsa | s |
<tbody>
</tbody>
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