Fresh Excel Tips

Quick and Easy Excel Tips and Tutorials

Archive for the ‘VBA Basics’

How to Write Subroutines Using VBA in Excel

Custom code, when using Excel and VBA, is written in functions and subroutines. We will be attaching our custom code to Excel’s main program and invoking our code within cell formulas or in response to certain events that occur inside Excel. One of the main things you need to remember is that the VBA procedures [...]

VBA Commenting and Line Continuation

Comments are very useful for tracking and documenting you code in VBA. Any text that follows an apostrophe is considered a comment and is always ignored by Excel. For example, the first line in the following code is a comment, as is everything following the apostrophe on the third line: ‘ Declare a string variable Dim FreshExcel [...]