+ Reply to Thread
Results 1 to 8 of 8

DO While Loop required

  1. #1
    Registered User
    Join Date
    07-29-2020
    Location
    Pakistan
    MS-Off Ver
    2016, 365
    Posts
    20

    DO While Loop required

    Looking to create a Do while loop to apply the below formula on each workbooks all sheets a folder have in PC. Right now applying this 1 by 1 on each workbook separately. Any help regarding post would be appreciated. Thanks

    HTML Code: 

  2. #2
    Forum Contributor Dante Amor's Avatar
    Join Date
    07-24-2020
    Location
    MEXICO
    MS-Off Ver
    Excel 2013
    Posts
    212

    Re: DO While Loop required

    Hi and welcome to ExcelForum.

    Change "C:\trabajo\folder2\" for the folder where the files are.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: DO While Loop required

    Quote Originally Posted by shabby01 View Post
    Please Login or Register  to view this content.
    Quote Originally Posted by Dante Amor View Post
    Please Login or Register  to view this content.
    Why the assignment to the function 'Array' is inside the loop (?), after all it is a "constant value" ...
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor Dante Amor's Avatar
    Join Date
    07-24-2020
    Location
    MEXICO
    MS-Off Ver
    Excel 2013
    Posts
    212

    Re: DO While Loop required

    Why the assignment to the function 'Array' is inside the loop (?), after all it is a "constant value"

    I didn't think about that, that's how it came in the original code.
    But you're right, it should be out of cycles, it should go for example:

    Please Login or Register  to view this content.
    thanks for comment

  5. #5
    Registered User
    Join Date
    07-29-2020
    Location
    Pakistan
    MS-Off Ver
    2016, 365
    Posts
    20

    Re: DO While Loop required

    Apologies for replying late. I'have tried this code where it asking to add the folder link i want to select the folder via the code.

    I have modified the code little as i want the code to work. But it is still not performing any action.

    HTML Code: 
    Last edited by shabby01; 08-10-2020 at 06:36 AM.

  6. #6
    Registered User
    Join Date
    07-29-2020
    Location
    Pakistan
    MS-Off Ver
    2016, 365
    Posts
    20

    Re: DO While Loop required

    I got by adding xFileName = Dir(xFdItem & "*.xlsx") thanks for your support.

  7. #7
    Forum Contributor Dante Amor's Avatar
    Join Date
    07-24-2020
    Location
    MEXICO
    MS-Off Ver
    Excel 2013
    Posts
    212

    Re: DO While Loop required

    I'm glad to help you. Thanks for the feedback.

  8. #8
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,143

    Re: DO While Loop required

    Quote Originally Posted by shabby01 View Post
    ... I have modified the code little ...
    shabby01, the variable 'Arr' is unnecessary in the loop as its value does not change, move it to the beginning of the code, that's where it belongs, e.g.:
    Please Login or Register  to view this content.

+ 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] Assistance required with VBA loop
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2016, 08:38 AM
  2. Object Required error in set loop
    By Tonan230 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2016, 05:43 PM
  3. Help Required for Loop with formula.
    By dfurn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2015, 07:34 AM
  4. Do Until loop or equivalent required
    By Nonboff in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2009, 05:54 AM
  5. Loop & Offset assistance required
    By Digory in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-20-2007, 04:30 PM
  6. Object required error in a loop
    By yellephant in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2007, 12:22 PM
  7. Help required with a simple Loop
    By Pedros in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-27-2006, 08:00 AM

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