Learn how to close a vba userform with escape key. Map command button to Exit or Close a Userform with Escape key.
Excel VBA Code to Checks if File Exists in Path
Finding an existing file & its path using Excel VBA When writing Excel VBA code that works with external files like XML or JSON, it is important that you have controls in your code to check it the file exist. If your macro (VBA program) doesn’t find a file when […]
VBA Convert Excel range to JPG Image
Get VBA code to convert Excel range to a image file.
Get Sheet Object Caption and Codename
Get Excel worksheet caption & name (or Object name or Codename) using VBA Macro. This is a readonly property and cannot be renamed using code without giving access to VBA Project Model.
Convert Html To Text In Excel
VBA code to convert html to plain text, this helps us to make the html code readable by stripping all the html tags from the html code and printing/rendering the output of the code. When we have a an Excel sheet with cells containing html. We can batch convert them […]
VBA Message Box Set No as Default Button
How to Set No or Cancel as default Msgbox button? In Msgbox with YesNo or OkCancel buttons, the first button will be set as default button. i.e., once the message box appears if user hit Enter button, Yes or Ok will be activated. Sometimes, this is not desired. In case […]
Excel VBA List Files in Folder – Dir in Shell
List Files in Folder using Excel VBA To get list of files in a directory, just give the folder path as input to this function. It will read the file in the folder one by one. Then display the file names. In this sample code, we will get list of […]
Add Excel VBA Drop Down Data Validation List
How to add Data validation drop down list in Excel VBA? Two different methods to create drop down list are explained here – but all are related to validation list. Note: Combo-box control that also display list of values in dropdown is not explained in this page. Adding Drop Down […]
[VBA] How to Convert Word Document to PDF?
This page explains how to save a word document to PDF using: VBA Code PDF Converter Manually Save Word as PDF Both the methods are simple & straight forward. Lets start with the automation code first. 1.VBA Code to Convert Word to PDF Word VBA has a direct function to […]
VBA Msgbox with Yes No Cancel Options
User Input Msgbox with Yes No Cancel Some time the VBA code has to get approval from user with Yes/No/Cancel optop. Here is the simple code snippet that get the Yes, No, Cancel options in a popup window. Example scenario for this would be like if there is any file […]