+ Reply to Thread
Results 1 to 2 of 2

Loop CommandButton click

  1. #1
    Registered User
    Join Date
    07-19-2015
    Location
    United States
    MS-Off Ver
    2016
    Posts
    18

    Loop CommandButton click

    Hi,

    Please I need help with this macro please.

    I would like the events to keep looping until there's no more value in a cell. The events are basically clicking on the links in cell L33 and once clicked, it moves on to visit the next link and so on. But before the automation visits the next link, I would like the webpage to be fully loaded before the automation visits the next link. For now, I have created a button that would visit the link in L33 but I don't want to keep clicking as I have hundreds of links to load so what I would like is that after the first click, the macro should keep running the events until there's no more link in L33 and the macro stops with a message box or something like that.

    Once clicked, the events of this button are:
    1. Load the web link in L33.
    2. Allow the webpage to be fully loaded.
    3. The web link moves up then the next one gets on cell L33.
    4. Repeat whole process until there's no more link, popup message box "DONE"

    Here's my code:

    Sub CommandButton1_Click()

    WebBrowser1.Navigate (Sheets("Sheet1").Range("L33").Value)
    WebBrowser1.Silent = True

    If WebBrowser1.ReadyState <> READYSTATE_LOADED Then

    Range("A32:L32").Select
    Selection.Delete

    End If

    End Sub




    I also attached my excel file.

    Many thanks,
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-19-2015
    Location
    United States
    MS-Off Ver
    2016
    Posts
    18

    Re: Loop CommandButton click

    Hi,


+ 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. Call a commandbutton click event from a module
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-19-2015, 01:10 PM
  2. Removing Item from ComboBox on CommandButton Click
    By hollyeva in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-17-2015, 11:06 PM
  3. Adding rows based on commandbutton click
    By milo1984 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2014, 07:32 AM
  4. Call procedure when I click any commandbutton
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2012, 04:33 AM
  5. Object required error on CommandButton Click
    By rkjudy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-09-2011, 06:05 PM
  6. Userform Commandbutton does not update on click
    By asha3010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-05-2010, 04:25 AM
  7. On the click event of commandbutton open another excel workbook
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2010, 06:28 AM

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