Mindblown: a blog about philosophy.
-
How To Run Macro (VBA) When The Cell Value Changes
In this post, you are going to find out how to detect when a cell value on your worksheet changes. So when my F7 value changes from “george” or blank to something else, a message box appears. Here is the code: Private Sub Worksheet_Change(ByVal Target As Range) Static blnDoneThis As Boolean Dim varOldValue As Variant…
-
How To Parse JSON With Excel VBA
I didn’t come up with this code, but it is pretty cool. It shows how to parse a JSON string with VBA. The impetus for this was to access the price data for various coins on coinmarketcap.com …and to get the price data for 50+ coins required getting a coinmarketcap api, and resulted in a…
-
How To Load A Text File In Excel VBA With Load Data Infile
So for reference sake, here is something easy. This is how to load a local text file into a variable, so you can process it. For example: So you have some JSON file, and you put the JSON formatted text locally in a text file so you can experiment on parsing it before you actually…
-
Automatic Invoice Number Generator Excel VBA Project
This post is actually in response to an Excel VBA question. Basically it can be summarized by titling it “automatic invoice number generator excel” That is what this is: This can be filled out with user form, but all the data ultimately gets entered into the underlying spreadsheet so we’ll skip the user form part…
-
How To Have Excel Check If Range Of Cells Contains Specific Text With VBA
Here’s an example of how to check if a value exists in a range of cells: It is actually a response from a question I received: “Can you let me know how to check if a particular value is present in a named list. Or in a different worksheet” You can use the “countif” function.…
-
Checking If Month Changed – Excel VBA Old Value Cell Target
In response to a comment on my Youtube video: https://www.youtube.com/watch?v=Z9kt86I_rq0&feature=em-comments *This gives an example of how to get notified of a change made to one of the worksheet cells. Private Sub Worksheet_Change(ByVal Target As Range) Static blnDoneThis As Boolean Dim varOldValue As Variant Dim varNewValue As Variant ‘initialize a variable to regulate the Worksheet_Change event…
-
VBA Copy And Paste Sample
I had another interesting question involving copying and pasting some values over 1500 rows so I generated the code in VBA and decided to post it here. Here is the “pseudocode” (my though process, which you should do in order to structure your thoughts): 1. loop through the cells 2. select c13:L16 -> copy 3.…
-
How To Use VBA To Loop Through The Files In A Folder
So, picture this…you have a client who just has the files in a folder illustrated by a picture, like a jpg. You need the file names from the picture, but you can use an OCR (Object Character Resolution) to list the files on the image because a lot of the text shows up like garbage.…
-
How To Trigger An Excel VBA Event When Cell Value Is Deleted
This post actually was birthed from a comment made on one on my Youtube videos: I wanted to know as how to trigger an event when a cell value is deleted? (a comment to this post’s video: http://www.vbastring.com/blog/how-to-run-a-macro-when-cell-value-changes-in-excel-vba/) So we are going to trigger an Excel VBA event when a value is deleted from a…
-
How To Have VBA Parse A Name String
This post was actually an answer to someone’s question on one of my videos from a few years back. https://www.youtube.com/watch?v=UspqR0g4XyU The comment was: How would you do this for the last name? Or second last name? How to find the space after the first space, and the space after the second space? And then, if…
Got any book recommendations?