Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6597467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:12:47+00:00 2026-05-25T18:12:47+00:00

Does the size of excel workbook effect the running of a VBA code? I

  • 0

Does the size of excel workbook effect the running of a VBA code? I have written a VBA code into a excel workbook whose size is 200 MB.The excel workbook has the browse button and these browse button picks another Excel file and performs operations and write backs some of the needed contents to the 200 MB size file. But these operation is too slow taking 8 to 13 min. These excel workbook contains charts, graphs and more modules and 16 sheets and pivot tables lots of stuff.(will these effect to run the vba code?)

But the same code I have written to another new excel workbook which is of size 200KB with the same browse button and all that stuff and here it took 4 seconds to finish. I wonder whats going wrong. Using for loops is harmful for a big file but I cannot perform my operation using without a loop in my code.If for loop is harmful then it should even effect 200KB size but no danger with that! what I have to do now?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:12:48+00:00Added an answer on May 25, 2026 at 6:12 pm

    Make sure you have used Application.ScreenUpdating=False and Application.Calculation=xlManual before the code that writes to the workbook. (Then reset them at the end).

    Also there is a big overhead on each read and write to a Range, so its usually much faster to read a large block of data into a variant.

    Dim vArr as Variant
    vArr=Worksheets("Sheet1").Range("A1:Z9999").Value2
    
    'Manipulate the resulting array.
    For j = LBound(vArr) To UBound(vArr)
       For k = LBound(vArr,2) To UBound(vArr,2)
          vArr(j,k)=vArr(j,k)*2
       Next k
    Next j
    
    'And then write it back to its destination.
    Worksheets("Sheet2").Range("A1:Z9999")=vArr
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does the results of IntPtr.Size show the OS that the .NET app is running
Does anyone know of any sample code for restoring a window's position and size
Below is the code I'm using to load the data into an Excel worksheet,
I am still not clear what does size in em mean? I have worked
I have an Excel workbook with a number of features: One main user-facing sheet
If I have a lot of instances of a single class, does the size
Could someone explain what this code does size = *(int *)data; // size of
Does the size of a .net assembly affect performance at all? How about the
How does one choose the size of a buffer (bytes I read from or
Does anyone know how to change the size of a panel in the gui

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.