*** NOW OPEN TO FOUNDING MEMBERS - JOIN THE EXCEL VBA INNER CIRCLE NOW! CLICK HERE TO LEARN MORE ***

Working with Colors in Excel VBA

In this Blog post I cover all ways and tips for using color codes in your Excel VBA program. Discover how to store colors as constants, identify the code of any color and apply colors to any Excel object.

Understanding Color Codes

Every color is identified by a unique number. For example, 255 represents Red. 16774980 represent a specific cyan.

You can also convert any decimal number to its Hexadecimal representation (or Hex for short). For example, that cyan color number equals FFF744 in Hex representation (use any decimal to hex converter you find on the web to see how it works).

You can...

Continue Reading...

Object Oriented Programming with Excel VBA – Part 2

In this advanced chapter of OOP with Excel VBA, we implement objects composition with a dynamic collection in Excel VBA using Class Modules. Not for the faint of heart…

In Part 1 on this exercise of implementing OOP in Excel VBA, we left off with a half-baked order object. It had some properties and a couple of methods, but its line-items were missing.

Today we’re going to round up our order object to include its line-items.

Thinking about the right structure and arrangement of the line-items within the order object, two main characteristics should guide our thinking:

  1. An order...
Continue Reading...

Object Oriented Programming with Excel VBA – Part 1

Ever wanted a concise, clear with code examples guide to implement OOP in Excel VBA? It is your lucky day. Read on…

After we covered in detail what OOP is in last week’s Blog post, we’re ready to see how this works in Excel VBA.

Keep your eyes on the Object

The key concept to keep in mind as we implement objects in Excel VBA, is that we are creating our own custom objects, on top of the available objects at our disposal out of the box.

The image here shows a list of the available properties and methods of the Workbook object.

This list is the exposed interface of the...

Continue Reading...

Understanding Object Oriented Programming

If we live in a world of objects and our computer programs help us manage our world, how about representing the world’s objects in our computer programs! * Object Oriented Programming explained

In order for you to understand this article, you need to know what an Object in computer programming is. Lucky for you, I just wrote about it last week.

Between Two Programming Paradigms

There are two dominating programming paradigms out there.

Procedural Programming

The basic concept is that of statements organized in modules and functions, executed in order.

Typically, there is a main...

Continue Reading...

Understanding Objects in Computer Programming

Objects are a key element in computer programming. While objects are at center stage in Object Oriented Programming, they are widely used in procedural languages and serve as the building blocks of complete applications * Let’s understand objects!

What is an Object?

Simply put, an object is any “thing” you can actually see, physically.

For example, a person, a car, a pencil, a circle – are all physical objects.

Extending our perception of object to understand how objects are used in computer programming, an object can also offer a well-defined service: A Government...

Continue Reading...

Is Your Excel VBA Running SLOW? Here are 6 Tips to Improve Your Excel VBA Performance

A prospect asked me once if I can improve his VBA code performance. After 30 minutes analysis of his code, I committed to improve performance in 95% * How can your Excel VBA code run faster, much faster?

Last week I offered some advice on improving the performance of your Excel Workbook. This week, we’ll improve your VBA code!

A story of frustration with slow VBA

Most of the VBA code out there is a result of advanced Excel users who learned some VBA statements. They know how to reference Worksheet cells, how to run a loop and maybe manage multiple Workbooks and Worksheets.

They...

Continue Reading...

Excel is slow? Here are possible causes and ways to make Excel run faster

You’ve spent days in perfecting your Excel model. Sophisticated formulas spanning multiple Workbooks are generating the results you need. But it is now heavy with long delays and response times. What could be the reason and what can you do about it?

The magic of live formulas has its toll

No doubt one of Excel’s magic is the “live grid” in which formulas connect cells, charts and formatting for real-time calculations and rendering. It Is so appealing, that we tend to forget that maintaining the web of connected cells requires resources. Compute and memory resources.

...
Continue Reading...

Scheduling Automatic Excel VBA Programs for Uninterrupted Execution

Ever needed to run an Excel Macro every day automatically? I mean, without leaving Excel open or interacting with Excel at all. Here’s how you do this taking advantage of two technologies that comes with Windows

Why schedule a daily silent job?

In one of my customer’s project that manages trainings and certifications, employees receive email and SMS notifications on various events: upcoming training reminders, training result (with a certificate attached), change of instructor, training assessment reminders etc.

The technique for doing that is using a queue. All notifications...

Continue Reading...

Using Pre-Compiler Directives for Cross-Platform Compatibility of Your Excel VBA Programs

Need your single Excel program to run on Windows and Mac? With Office 32-bit and Office 64-bit? You can do that using pre-compiler directives * Here’s what you need to know (and code!)

In my Blog post from last week In which I elaborated on writing VBA code that runs on both Office 32-bit and Office 64-bit, we ended up with a challenge. We need to include the PtrSafe and LongPtr qualifiers in external libraries declarations for Office 64-bit, but ignore these qualifiers in Office 32-bit environments (where they are unknown).

Today I’ll explain all about VBA’s pre-compiler...

Continue Reading...

Writing Excel VBA Code That Runs on Office 32-bit and 64-bit

Your Excel 2016 program runs perfect on your Excel 2016 32-bit, but fails on Excel 2007, or on Excel 2013 64-bit. Why that happens and how to write a fully compatible VBA program? Here are the answers (and some VBA code)

In last week’s Blog post, I explained and demonstrated how Windows functions libraries, or DLLs, can be called from VBA.

Leveraging external functions to Excel is great, especially considering the vast variety of functions the Windows operating system offers. However, breaking the tight Excel environment is also subject to some compatibility issues.

Why are there...

Continue Reading...
Close

50% Complete

Two Step

Once you submit your details, you'll receive an email with a confirmation link. That's it! you're subscribed!