how can i add a timer to this hyperlink opening code

the attachde vba opens urls all at once . i want to specify a time delay....one that i can set when i run the macro...think i need a form control. any ideas?

thanks!
ALL-MACROS.xlsm
finnstoneAsked:
Who is Participating?
 
Rgonzo1971Commented:
then try
Public Sub Open_Google_Searches()

  Dim objCell As Range
  Dim intLoopcnt As Integer
  Dim lngDelay As Long
 
  intLoopcnt = 1
  For Each objCell In [a56:a64]
 
      DoEvents
     
      If Not IsEmpty(objCell) Then
        '   If Not (blnShell_Execute("http://www.linkedin.com/profile/view?id=" & objCell & "&trk=miniprofile-name-link%22" & "%22")) Then'
             '   If Not (blnShell_Execute("http://www.linkedin.com/vsearch/p?company=" & objCell & "&openAdvancedForm=true&companyScope=CP&locationType=Y&rsid=21620241421683495020&orig=ADVS" & "%22")) Then '
                   If Not (blnShell_Execute(objCell)) Then
' If Not (blnShell_Execute("http://www.google.com/search?hl=en&q=" & objCell)) Then '
'      If Not (blnShell_Execute("https://na3.salesforce.com/" & objCell)) Then '
   
            MsgBox "Could not launch:" & vbCrLf & vbLf & objCell, _
                    vbExclamation Or vbOKOnly, _
                    ActiveWorkbook.Name
         End If
      End If
     lngDelay = (10 + (intLoopcnt \ 10)) * 1000
     Call DelayMs(lngDelay)
     intLoopcnt = intLoopcnt + 1
  Next objCell
                
End Sub

Open in new window

0
 
Rgonzo1971Commented:
Hi,

pls try
Application.Wait(Now + TimeValue("0:00:02"))

Open in new window

Regards
0
 
finnstoneAuthor Commented:
I ACTUALLY NEED A TIMER THAT ITSELF IS VARYING

SO EVERY TEN LOOPS, IT CHANGES THE DELAY BY 1 SECOND. so delay for n=1-10 is 10 seconds and delay for n=11-20 is 11 seconds

attached is the code working so that every loop it changes by a fixed amount....got it that far, now just need it to be more dynamic
ALL-MACROS.xlsm
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
finnstoneAuthor Commented:
can you do another one? i will post it soon, similar algo logic
0
 
finnstoneAuthor Commented:
thx!
0
 
finnstoneAuthor Commented:
this overflows at 32000 (iteration 14)

lngDelay = (10 + (intLoopcnt \ 2)) * 2000
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.