How to delete row from the table downloaded from the internet?

djuksi13

New Member
Joined
Jun 20, 2017
Messages
13
Hello everyone,

I inherited a table that compares the exchange rate taken directly from the Internet to the one from the database of our system. Afterwards, on the page they added a line that I do not need and I do not want to compare, so I'm interested in how to delete it from the table?

My VBA code looks like this:

Sub Macro1()


With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.hnb.hr/tecajn/htecajn.htm", Destination:=Range("$C$5"))
.Name = "htecajn"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
Range("C5").Select
ActiveCell.FormulaR1C1 = "Srednji tečaj"
Range("C6:C18").Select
Selection.TextToColumns Destination:=Range("C6"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=True, Other:=False, FieldInfo _
:=Array(Array(1, 9), Array(2, 9), Array(3, 1), Array(4, 9)), TrailingMinusNumbers:= _
True
Range("A4").Select
ActiveWorkbook.Connections("Tecajna_lista").Refresh
End Sub


Thank you in advanced :)
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
In your spreadsheet, what is the criteria for the line of data to be deleted? In which column is this criteria located.
 
Upvote 0
Thanks for the response.

A new value is added to the C17 line that is added to the web site. In row C18 is the value that should be in C17, and in C19 there is an unstructured value that should go to C18. So, I need to delete C17 value/row.
 
Upvote 0
Maybe I didn't be clear.
I just wanted to delete specific cells from 1 row, because those data come directly from the web site...
 
Upvote 0
Will you always be deleting the value in C17 and moving the values up for all values in column C? If this is not the case, then you will need to be more specific in identifying the variable that is to be searched for and deleted. You will need to tell us the basis for which the particular cell value will be deleted.
 
Upvote 0
This code adds a new connection to your file everytime it is run, it should suffice to refresh the existing connection rather than adding a new one every time.
 
Upvote 0
This is not my solution and I just inherited it. Can you tell me what would be the best and easiest to do to get my program deleted only column A17: C17 when values are called?
 
Upvote 0
when values are called?
What does this mean? I urge you to explain in sufficient detail what you want to accomplish. Giving us a piece of code that does not work for you and asking us to fix it is not helpful to us. In simple English, explain your whole situation and someone here will guide you to a viable solution. We are not mind readers and what you are asking is convoluted.
 
Upvote 0
I'll try to explain as simply as possible.

I'm working on a macro-enabled table that retrieves data from one web site and compares this data with data from the database on our ERP system. The data is manually entered into the ERP system, and Excel only retrieves them from the system for comparison with the data from the web site (it says TRUE or FALSE).
An additional row of data has been added to the web page, the values of data we do not enter into the system, and that row of data needs to be deleted before comparing the two data (because we receive error in rows where is new data). I'm interested in which part of the above code at the top of the page should be changed or added to remove this data from review?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top