+ Reply to Thread
Results 1 to 17 of 17

Macro to get sequential links

  1. #1
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Macro to get sequential links

    Hello Friends.

    Can you please help me to create a macro. I have few links and need a sequential series for those links(one below anoher). For example I have numbers with me how many sequence I need to create for a particular link.
    For first link I need 3 incremental links for that, for second link count is 2 and for third count is 5. as shown in example below.


    Problem
    3 aabbcc.com&logHistory=true&page=1&searchlogreport
    2 depp.com&logHistory=true&page=1&searchlogreport
    5 hahfs.com&logHistory=true&page=1&searchlogreport

    Solution
    aabbcc.com&logHistory=true&page=1&searchlogreport
    aabbcc.com&logHistory=true&page=2&searchlogreport
    aabbcc.com&logHistory=true&page=3&searchlogreport
    depp.com&logHistory=true&page=1&searchlogreport
    depp.com&logHistory=true&page=2&searchlogreport
    hahfs.com&logHistory=true&page=1&searchlogreport
    hahfs.com&logHistory=true&page=2&searchlogreport
    hahfs.com&logHistory=true&page=3&searchlogreport
    hahfs.com&logHistory=true&page=4&searchlogreport
    hahfs.com&logHistory=true&page=5&searchlogreport
    Last edited by hjaspaul; 08-22-2020 at 08:29 AM.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Macro to get sequential links

    all you have to do it read the first byte of data in your first list, line by line and use it as a counter to copy the rest of that line's data multiple times to a new table below it or on a new worksheet. you can make use of the following functions:

    => LEFT()
    => MID()
    => RIGHT()
    => RANGE()

    if you're participating in a web scraping project though, be aware that some website have policies stating that they do not allow it. However, I don't think they can do much about it if you violate those terms. Just saying....resources have to be used to monitor activity like that.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Macro to get sequential links

    Assuming data in Col.A, output in col.C
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    Thanks Adam, but I have a huge list and breaking it down to formulae for each col will be too much manual work, so that why only macro can help here to expedite. Thankyou for helping me here.

    Thanks for help jindon but macro is not working. Just showing a sample in snapshot how the outcome should look like. The only thing which will change in each link is number in page. speerate links will be created based on col A value and it should be like page = 1, page = 2, page = 3 will be the only diff in each link. Thanks for helping me with your precious knowledge and time.

    Attachment 692163

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Macro to get sequential links

    hjas,

    jindon can probably help you out, but just so you know, like everyone I've told so many times, whenever you upload images the way you did, for some reason I cannot see them. here is what I see. can you upload it another way?
    Attached Images Attached Images
    Last edited by vba_php; 08-22-2020 at 07:24 PM.

  6. #6
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    Sorry,

    here is the excel sheet attached
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Macro to get sequential links

    I thought
    3 aabbcc.com&logHistory=true&page=1&searchlogreport
    is in one cell...

    Change to
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    Thanks Jindon, it is not working for me. Sorry to be naive but I am attaching the file. Can you please see am I missing something here or doing something incorrectly.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Macro to get sequential links

    The code should be in a standard code module, not in Class module.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    Thanks Jidon. Yes this is working. And thanks for guiding me.
    Just slight tweak is needed. For second link page numbers should increase. For increase first link will have page=1, second link will have page=2, third link will have page=3, and everyhting else in the sting should remain the same

    3 aabbcc.com&logHistory=true&page=1&searchlogreport
    2 depp.com&logHistory=true&page=1&searchlogreport
    5 hahfs.com&logHistory=true&page=1&searchlogreport

    Solution
    aabbcc.com&logHistory=true&page=1&searchlogreport
    aabbcc.com&logHistory=true&page=2&searchlogreport
    aabbcc.com&logHistory=true&page=3&searchlogreport
    depp.com&logHistory=true&page=1&searchlogreport
    depp.com&logHistory=true&page=2&searchlogreport
    hahfs.com&logHistory=true&page=1&searchlogreport
    hahfs.com&logHistory=true&page=2&searchlogreport
    hahfs.com&logHistory=true&page=3&searchlogreport
    hahfs.com&logHistory=true&page=4&searchlogreport
    hahfs.com&logHistory=true&page=5&searchlogreport

  11. #11
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    Format of links are different, it is not necessary that links will have same format. for the entire link I just need Page=1 count to increase and nothing else. You are very close to solution, thanks again for the time and my silly queries.

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Macro to get sequential links

    It is working as it is.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    I gave this seperate link
    def/243288?doFetchHeroCard=false&functionIncluded=4%2C13%2C16%2C15%2C25%2C19%2C20%2C8%2C9&geoIncluded=101165590&logHistory=true&page=1&searchSessionId=famXfD2oTsG%2B67Uge9wixw%3D%3D&seniorityIncluded=4%2C6%2C9%2C7%2C10%2C8%2C5


    Output I am getting for this is below 2 links, where only geoIncluded=1 and geoIncluded=2 are getting reflected instead of page =1 and page=2...The sequence of these links are going to be changed, and only page sysntax is the only main thing which will give incremental sequence to the link.
    def/243288?doFetchHeroCard=false&functionIncluded=4%2C13%2C16%2C15%2C25%2C19%2C20%2C8%2C9&geoIncluded=1&logHistory=true&page=1&searchSessionId=famXfD2oTsG%2B67Uge9wixw%3D%3D&seniorityIncluded=4%2C6%2C9%2C7%2C10%2C8%2C5
    def/243288?doFetchHeroCard=false&functionIncluded=4%2C13%2C16%2C15%2C25%2C19%2C20%2C8%2C9&geoIncluded=2&logHistory=true&page=1&searchSessionId=famXfD2oTsG%2B67Uge9wixw%3D%3D&seniorityIncluded=4%2C6%2C9%2C7%2C10%2C8%2C5

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Macro to get sequential links

    Can you just upload a data that you are working with and the result that you want in a workbook?

  15. #15
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    File sample attached. The only thing which change in all links is pagenumbers. page=1, page=2, page =3 (everything else remains the same) based on the value mentioned in Col A w.r.t link in Col B
    Attached Files Attached Files

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Macro to get sequential links

    For the data attached.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    04-14-2016
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    44

    Re: Macro to get sequential links

    Sir you are Awesome. Thanks for your valuable Time and help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Copy from sequential workbooks into a single workbook with sequential columns
    By YeknomDude in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2017, 01:40 PM
  2. Replies: 3
    Last Post: 01-30-2014, 05:31 AM
  3. Replies: 32
    Last Post: 07-23-2013, 01:14 AM
  4. [SOLVED] Create sequential letters (A, B, C) in sequential cells
    By Theale in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-29-2012, 02:47 PM
  5. How to copy sequential vales into non sequential rows
    By dchalem in forum Excel General
    Replies: 11
    Last Post: 01-18-2011, 12:19 PM
  6. [SOLVED] ASAP-Apply sequential cell links to different controls simultaneou
    By Hubitron2000 in forum Excel General
    Replies: 0
    Last Post: 03-17-2006, 01:10 PM
  7. [SOLVED] Non-sequential VLOOKUP function -OR- sequential sort of web query
    By Eric S in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-28-2005, 04:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1