Results 1 to 3 of 3

Opening Mutliple Hyperlinks with Pause Between

Threaded View

randell.graybill Opening Mutliple Hyperlinks... 04-04-2009, 03:25 AM
randell.graybill Re: Opening Mutliple... 04-04-2009, 05:05 AM
randell.graybill Re: Opening Mutliple... 04-05-2009, 02:32 AM
  1. #1
    Forum Contributor
    Join Date
    04-03-2009
    Location
    USA, California
    MS-Off Ver
    Excel 2007
    Posts
    385

    Opening Mutliple Hyperlinks with Pause Between

    I previously posted another post regarding my overall goal of what I want to do but may have to scale back on the project or get help with it bit by bit...so instead I ask for help with the following code if anyone could help fine tune it.

    What I want is for the macro to open each hyper link in the range, but pause for 5 seconds after it opens each one.

    here is what I have and it works kinda:

    Sub OpenLinks()
    Dim Pallets As Range, Cell As Range
    
    Set Pallets = Range("F2:F11") 'Range containing hyper links
    
    For Each Cell In Pallets
    
    If IsEmpty(Cell) Then
    Exit Sub
    End If
    
    If Cell.Value <> "" Then
    
    Cell.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=False
    End If
    Next
    
    For a = 0 To 3
    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 3
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
    If Application.Wait(Now + TimeValue("0:00:3")) = True Then
    End If
    Next a
    
    Set Pallets = Range("F12:F21")
    
    For Each Cell In Pallets
    
    If IsEmpty(Cell) Then
    Exit Sub
    End If
    
    If Cell.Value <> "" Then
    
    Cell.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=False
    End If
    Next
    
    For a = 0 To 3
    newHour = Hour(Now())
    newMinute = Minute(Now())
    newSecond = Second(Now()) + 3
    waitTime = TimeSerial(newHour, newMinute, newSecond)
    Application.Wait waitTime
    If Application.Wait(Now + TimeValue("0:00:3")) = True Then
    End If
    Next a
    
    Set Pallets = Range("F22:F31")
    
    For Each Cell In Pallets
    
    If IsEmpty(Cell) Then
    Exit Sub
    End If
    As you can see the method I'm using doesn't work very well and it is alot of code. The above example shows a pause of 9 seconds but I would like to cut that back to 5 seconds and open only 1 link at a time.

    This post has now been cross posted at: http://answers.yahoo.com/question/in...4005448AAkGdJK
    Last edited by VBA Noob; 04-04-2009 at 06:09 AM.

Thread Information

Users Browsing this Thread

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

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