+ Reply to Thread
Results 1 to 2 of 2

Reduce processing time for saving excel sheets located in a folder

  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    39

    Reduce processing time for saving excel sheets located in a folder

    I have a number of excel sheets which I need to assess.
    Idea was to place all the excel sheets in one location and process them simultaneously
    So, I would place the excel sheets in folder "Show" and then would run the macro to add the word "inplace" if the column H was containing some data, and then it would save the excel sheet.



    I have the following code which works but takes about 98 seconds to process ( too long) .. Need help to reduce the processing time or to develop a new logic which can reduce the time to process.

    Sub Trial()

    Dim Master As Workbook
    Dim sourceBook As Workbook
    Dim CurrentFileName As String
    Dim myPath As String

    Application.ScreenUpdating = False
    Application.DisplayAlerts = False



    Set Master = ThisWorkbook


    myPath = "D:\Show"
    CurrentFileName = Dir(myPath & "\*.csv")

    Do
    Workbooks.Open (myPath & "\" & CurrentFileName)
    Set sourceBook = Workbooks(CurrentFileName)

    Columns(24).Formula = "=if(H1="""","""",""InPlace"")"
    Columns(24).Value = Columns(24).Value

    ActiveWorkbook.Save
    sourceBook.Close (False)

    'Calling DIR w/o argument finds the next .xlsx file within the current directory.
    CurrentFileName = Dir()
    Loop While CurrentFileName <> ""


    MsgBox "Done"

    Application.ScreenUpdating = True
    Application.DisplayAlerts = True

    End Sub

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Reduce processing time for saving excel sheets located in a folder

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ 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. Replies: 9
    Last Post: 04-18-2012, 08:50 AM
  2. Replies: 3
    Last Post: 02-06-2011, 05:29 AM
  3. Reduce Excel File while saving
    By nnram123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2010, 07:27 PM
  4. Reduce processing load in Excel
    By Lance Gray in forum Excel General
    Replies: 0
    Last Post: 12-29-2005, 01:30 PM
  5. macro for processing one excel file and saving it to other
    By shwetaparekh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-30-2005, 07:05 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