+ Reply to Thread
Results 1 to 13 of 13

Do While Loop never stops

Hybrid View

  1. #1
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Another way without an object variable …


    Quote Originally Posted by chasoe View Post
    it is just a normal simple module under VBA Project Explorer.
    PHP Code: 
    Sub CAL_ALLOpen()
          
    Dim P$, F$, L&
         
    With Application
             
    .AskToUpdateLinks False
             
    .EnableEvents False
             
    .ScreenUpdating False
              P 
    ThisWorkbook.Path "\"
              F = Dir(P & "
    *CAL*.xls")
        While F > ""
              L = L + 1
            With Workbooks.Open(P & F)
                .Sheets("
    CAL-GTT").[F9].Value2 = 500
                .Close True
            End With
              F = Dir
        Wend
             .AskToUpdateLinks = True
             .EnableEvents = True
             .ScreenUpdating = True
         End With
              MsgBox L & " 
    files modified", vbInformation, "Updating CAL"
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  2. #2
    Forum Contributor
    Join Date
    03-27-2015
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: Another way without an object variable …

    Looks too advanced for me to understand, as I'm only a beginner in VBA and all the codes comes from the google search and adapted to fit my need.

    And it's bad news as the codes fail again even after adding "Enable Event" stuff.

+ 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. [SOLVED] Creating loop that stops after certain string
    By letsExcelebrate in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2017, 05:16 PM
  2. [SOLVED] Do While ....Loop Never Stops
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-17-2013, 09:29 AM
  3. VBA - Loop stops too soon
    By DavidBW in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2013, 06:42 AM
  4. loop that stops when certain value is obtained
    By ukhan12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-07-2013, 10:41 PM
  5. [SOLVED] A Loop does not loop throught. It stops after two cells.
    By AB33 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-14-2012, 01:14 PM
  6. Code Stops in a loop?
    By playtowinpb@msn.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-19-2011, 01:57 PM
  7. Formula in loop stops working
    By Jim73 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-08-2005, 12:06 PM

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