Google Chrome using Macro

matrix

New member
Joined
Dec 21, 2019
Messages
28
Reaction score
0
Points
0
Excel Version(s)
2019
Hello Forum.


I am wondering, how to modify this code below to suit me needs.

Code:
[COLOR=#2C3E50][FONT='inherit']
[LIST=1]
[*]Sub EXPORTONGLETS()
[*]'VALID DECLARATION
[*]    Dim NOMFEUILLE As String    'NAME VARIABLE FOR THE HOME TAB
[*]    Dim NBLIGNES As Long  ' VARIBLE NUMBER OF LINES PROVIDED IN NEWS
[*]    Dim LADATE As Date   ' EXPORT DATE INDICATION
[*]    Dim t$
[*]    With Worksheets("News")
[*]        NBLIGNES = .Range("A" & .Rows.Count).End(xlUp).Row
[*]    End With
[*]    LADATE = Format(CDate(Now), "dd/MM/yyyy")
[*]    'WE LAUNCH A LOOP ON ALL THE LINES OF THE NEWS TAB FROM LINE 2 TO THE END
[*]    For i = 3 To NBLIGNES
[*]        t = GetHash(Worksheets("News").Range("B" & i).Value)    'GetHash
[*]        'RECOVER THE NAME OF THE TAB INDICATED IN COLUMN (A) OF NEWS
[*]        NOMFEUILLE = Worksheets("News").Range("A" & i)
[*]        If IsError(Application.Match(t, Worksheets(NOMFEUILLE).Columns(3), 0)) Then    'check Hash
[*]            'WITH THE DESTINATION SHEET, WE INSERT A LINE IN LINE 3 THEN WE INFORM
[*]            With Sheets(NOMFEUILLE)
[*]                .Rows("2:2").Insert Shift:=xlDown
[*]                .Range("A3").Value = LADATE
[*]                'Worksheets(NOMFEUILLE).Range("B3").Value = Worksheets("News").Range("B" & i).Value
[*]                Worksheets("News").Range("B" & i).Copy .Range("B3")
[*]                .Range("C3").Value = t
[*]                .Rows("3:3").EntireRow.AutoFit
[*]            End With
[*]        End If
[*]        'GO TO THE NEXT NEWS VALUE
[*]    Next i
[*]    With Sheets("News").Activate
[*]    End With
[*]End Sub
[*]Function GetHash(ByVal txt$) As String
[*]    Dim oUTF8, oMD5, abyt, i&, k&, hi&, lo&, chHi$, chLo$
[*]    Set oUTF8 = CreateObject("System.Text.UTF8Encoding")
[*]    Set oMD5 = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider")
[*]    abyt = oMD5.ComputeHash_2(oUTF8.GetBytes_4(txt$))
[*]    For i = 1 To LenB(abyt)
[*]        k = AscB(MidB(abyt, i, 1))
[*]        lo = k Mod 16: hi = (k - lo) / 16
[*]        If hi > 9 Then chHi = Chr(Asc("a") + hi - 10) Else chHi = Chr(Asc("0") + hi)
[*]        If lo > 9 Then chLo = Chr(Asc("a") + lo - 10) Else chLo = Chr(Asc("0") + lo)
[*]        GetHash = GetHash & chHi & chLo
[*]    Next
[*]    Set oUTF8 = Nothing: Set oMD5 = Nothing
[*]End Function
[/LIST]
[/FONT][/COLOR]

Below. I have a list of 66 web link on worksheet tab “Bond”. Beginning on Cell N2. (See sample worksheet link below).


Each web link data is copied from website and is paste into a table, beginning in Cell B2 & B3. In other words. Each link represents two cells. “Date & price” and continue downwards. (see example).


Example: Just to highlight a few…
Column AColumn B (Date)Column c (price)Column N (Web Link)
Argentina1/3/202157.05https://www.investing.com/rate…ond-yield-historical-data
Australia1/3/202168.235https://www.investing.com/rate…ond-yield-historical-data
Austria1/3/2021875.69https://www.investing.com/rate…ond-yield-historical-data

The problem is, how can I copy and paste data?


Below you can view the photos of one web link example of the two steps process to copy the data.


Once you understand the first steps. The other links follow the same process… Please view photos below…


Step #1. To change daily data to weekly data. Please see photo highlighted in red...https://imgur.com/NqGoyJv


Step #2 The photo is highlighted in black. Data is copied and paste: Date (Jan 03, 2021) to paste in CellB2 & Price (57.05) paste into Cell C2.
https://imgur.com/TfPWbFV


I am not sure if you can help me. How can you all point me to the right direction?


Thanks in advance.


Excel File Here: https://drive.google.com/file/d/18uSepUjxIxmnw2rOR5MemDp7vr56YdvG/view?usp=sharing[/URL


Order of links in excel file
 

Pecoflyer

Admin Alumnus
Joined
Oct 13, 2011
Messages
1,766
Reaction score
0
Points
36
Location
Brussels Belgium
Excel Version(s)
2010 on Xubuntu - O365
Hi and welcome
Please,do not crosspost your question on multiple forums without including links here to the other threads on other forums.

Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
If you have fewer than 10 posts here, you will not be able to post a link, but you must still tell us where else you have asked the question


This is not the first time you have been warned about this behaviour. Any other offence will deprive you from accees to the forum

Do not post any further responses in this thread until a link has been provided to these cross posts.
 
Last edited:

matrix

New member
Joined
Dec 21, 2019
Messages
28
Reaction score
0
Points
0
Excel Version(s)
2019
I am sorry. I am not sure what to do?
 

Pecoflyer

Admin Alumnus
Joined
Oct 13, 2011
Messages
1,766
Reaction score
0
Points
36
Location
Brussels Belgium
Excel Version(s)
2010 on Xubuntu - O365
Just follow the requirements of post #2. Post links to ALL your cross posts
 

Pecoflyer

Admin Alumnus
Joined
Oct 13, 2011
Messages
1,766
Reaction score
0
Points
36
Location
Brussels Belgium
Excel Version(s)
2010 on Xubuntu - O365
For the last time, add links to ALL your cross posts.
 
Top