vba-instr-function

How To Parse A Flat File In Excel VBA

In another post I demonstrated how to access a file on your computer using the MS Office Library. Here it is if you don’t know what I’m talking about. In this post, I am going to show you how to access the file and load it into your spreadsheet. I will do the same thing […]

Continue Reading

How To Generate A XML File With Access VBA

XML is used to structure your data. You can send a CSV file to another person, but using XML, you can structure your data in a more elegant format, and get very specific about your fields, and what data is contained within your tags (your field names). This is different than a basic CSV file […]

Continue Reading

How To Search A String With The VBA Instr Function

The VBA Instr Function is very useful for searching a string for a particular piece of text. If for example you want to loop a column or a field in a table of multiple rows, and want to identify prize rows that are 81.51, you would write something like this: Sub VBAInstrFunction() Dim dblTemp As […]

Continue Reading

How To Do A VBA CSV Import For One To Multiple Files

So you want to be able to import your csv for 1 to multiple files. Here’s how you do it. 1. up a form with a button. 2. After you click the button, you will get a File Dialog Box that will show you the csv files to choose from: Here is the code behind […]

Continue Reading

How To Have Access Export A Table To An Excel XLSX In VBA

This was regarding a question I received from this blog: Hello, I am hoping to find some help. I have an Access DB that I use to collect data. I have a number of different reporting features. I would like to add the option for my user to export to excel. When I do this […]

Continue Reading

How To Use VBA To Extract Outlook Emails To Access Table

I use this code to extract outlook emails from a certain Outlook folder of a user (like the user’s Inbox) whenever they leave the department. This code will loop the Outlook Inbox (or other folder) of the logged in user’s Microsoft Exchange Account, and insert the body of the message into an Access table. Note: […]

Continue Reading

How To Extract Data From Outlook To Access With VBA

In this post you are going to find out how you can extract data From Outlook to Access with VBA”. Someone at the place I’m working at was let go, and they wanted the information, primarily from the user’s Outlook inbox, to be extracted to an outside application so the particular information about various projects […]

Continue Reading

VBA Do Loop

Looping structures like the VBA Do Loop allow you to specify the conditions under which you would like your program to run a set of code statements repeatedly. There are 4 different variations of the VBA Do Loop we are going to look at: ‘Do While…Loop structures check the condition before running the code. ‘The […]

Continue Reading

VBA Debug Part 1

In this video I talk about VBA Debug aspects like setting breakpoints, viewing the current state of variables, and stepping through code. …as well as: Set breakpoints to stop program execution. Test variables in the immediate window. Monitor variable values in the Locals window. Here is the video: Private Sub btnValidate_Click() If IsEmailAddress(Me.txtEmail) Then MsgBox […]

Continue Reading

A Variable Scope

Key points: A private procedure can be called from any procedure in the same module. The default scope for a sub procedure is “Public” unless you specifically designate it as Private. Store all your procedures and functions you plan to use in your application in “Modules”, which you can call from your other database objects. […]

Continue Reading