Hot answers tagged

3

Whenever you find yourself writing a block of nearly identical code, I recommend creating a common function that simplifies and isolates that functionality. The advantage is that you now have a single location for the logic and can easily make a change that is consistent for each instance you need to use that logic. In your case, you are repeatedly finding ...


3

There are a few things you can do in your coding to improve both the logic and the organization of your application. Your code does work and kudos for already using a memory-based array to speed up the processing of (partially) filling out your date axis. My suggestion solution below does not use Collections, but creates a two-dimensional array for reasons I'...


2

You are using the Double data type for all variables. I think this is a good thing since it should avoid conversions. But it is probably too large for your purpose. From the doc: Double (double-precision floating-point) 8 bytes -1.79769313486231E308 to -4.94065645841247E-324 for negative values Source: Data type summary Perhaps using the single ...


2

Use References in place of CreateObject If you include the reference to the Microsoft Scripting Runtime you can reduce the dim and set of objFSO to Dim fso As New Scripting.FileSystemObject to increase readability. Note that i have removed the obj prefix as it is no longer dimmed as an object. Similarly, this can be done with the file as Dim ...


Only top voted, non community-wiki answers of a minimum length are eligible