vba-do-loop

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 can I interact with other Office applications (Excel) using VBA in Access?

Need to write your Access data or query to an Excel file? Here is the how to do it: Most people are familiar with Excel and know how to use it well (enough), and when you start talking about Access, they get scared off, and don’t know what to do anymore. Well, here you are […]

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

Here Is A Customized Msgbox VBA Example

Here is an example of a customized VBA Msgbox. We giving some richtext and customizable flair to the rather ordinary message box. The following code provided with the code after the screenshot, is going to provide you with the ability to really make the ordinary message box shine! Sub MsgboxVBAExamples() Dialog.Box “VBAHowTo.com is your source […]

Continue Reading

Here Is An Example Of The VBA Trim Function

The “Trim” function is useful in eliminating the blank spaces in a string normally caused by some data entry error. Why do you want to do this? Well because a sorting error can happen if you are trying to sort ” Dan, “Fred”, and “Ann”. ” Dan” will show up on top before “Ann” because […]

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 Write A Recordset To File With VBA

In this video you’ll find out how to write a recordset to a file with VBA using the Microsoft Scripting Object. You’ll find out how to take your table data, and export it to a csv formatted file so you can share it with other applications. Use this method to get your data out of […]

Continue Reading

Excel VBA Read Text File

So how can you import the contents of a csv or text file into your Excel worksheet: Find out: ‘======================================================== ‘DESIGNED & CODED BY LOEBLCOM SERVICES 2013 ‘ERIK LOEBL(713)409-7041 ‘EMAIL: erik@loeblcomservices.com ‘WEB: http://loeblcomservices.com ‘======================================================== Sub query_text_file() ‘PURPOSE: Query A Text File ‘************************************* ‘clear ‘Text File Contents’ worksheet ‘************************************* Worksheets("Text File Contents").Select Range("A2:K6500").Clear ‘************************************* ‘now populate […]

Continue Reading

VBA Read Excel File

Here is a question I received “Thanks for the video, I have a question.How to read from a group of closed excel files searching for a certain value in say column F then if that value is found then copy that row to a workbook and continue search for then next value ” So I […]

Continue Reading

VBA Debug Part 2

In this video I talk about VBA Debug aspects like the Immediate Window, Local Window and Watch Window. …also we use the “debug.print” statement to print a value to the Immediate window. The Local Window is useful to view the current state of all the variables present in the current sub procedure. The Watch Window […]

Continue Reading