• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Excel VBA

working with comments in vba

Working With Comments in VBA

August 1, 2019 by Philip Treacy

To start with let's understand that I'm talking about the 'old' style comments like the one on the left. In Office 365 we now have Threaded Comments which are also being referred to as comments, with the old style comments being referred to as Notes in O365. But if you are not using O365 then …

Read moreWorking With Comments in VBA
custom data types in vba

Custom Data Types in VBA

July 2, 2019 by Philip Treacy

If you are working with several variables that relate to one thing, for example you are working with employee data, and every employee has a first name, last name, location and salary, you could set them up like this But if you want to work with data relating to several employees then you're going to …

Read moreCustom Data Types in VBA
Web Scraping Filling in Forms

Web Scraping – Filling in Forms

May 30, 2019 by Philip Treacy

I've written about web scraping before using VBA, but never about interacting with the website to do things like filling in forms. We had a forum question asking how to do exactly that so I tried using the same approach as I had previously with the HTML Object Library, but when it came to grabbing …

Read moreWeb Scraping – Filling in Forms
find and unmerge merged cells using vba

Find and Unmerge Merged Cells with VBA

April 10, 2019 by Philip Treacy

If you've worked with merged cells you may know that they can cause issues with things like copying and pasting, sorting, and counting cells. Merged cells can cause VBA to fall over too, so it is best to avoid them. Using Center Across Selection is a better option. CTRL+1 is the shortcut to open Format …

Read moreFind and Unmerge Merged Cells with VBA
Static variables in VBA

Static Variables in VBA

April 4, 2019 by Philip Treacy

Normally variables cease to exist once your Sub or Function has finished executing. Static variables allow you to preserve a value after your code has finished. Let's say you want to keep track of the number of times something happens, like how many times someone clicks on this button they are not supposed to.

Read moreStatic Variables in VBA
scheduling macros in excel with application ontime

Scheduling Macros in Excel With Application.OnTime

March 1, 2019 by Philip Treacy

If you need Excel to run some VBA at a specific time, or repeatedly at set intervals, you can use the Application.OnTime method. A basic call to Ontime requires that you supply a time when you want the code to run, and the name of the macro you want to run. The argument EarliestTime is …

Read moreScheduling Macros in Excel With Application.OnTime
regex regular expressions in excel

RegEx (Regular Expressions) in Excel

February 22, 2019 by Philip Treacy

RegEx stands for regular expression and is a sequence of characters that defines a pattern that can be used to match against strings. Or, in simpler language, I can create a regex pattern and use it to search a string for that pattern. I can also use the regex pattern to validate input. A simple …

Read moreRegEx (Regular Expressions) in Excel
vba like operator

VBA Like Operator

January 15, 2019 by Philip Treacy

The VBA Like operator allows you to compare strings against a pattern. You can search a string to check if it contains another string, or you can check if a string conforms to a certain format. By searching if a string contains another string, Like does a similar job to the InStr string function, but …

Read moreVBA Like Operator
play audio and video files in excel

Play Audio and Video in Excel

December 13, 2018 by Philip Treacy

We've had a few forum questions recently asking how to play audio files in Excel. Normally I'd just use my media player for this but I can see that you might want to have an audio or video file that may explain something about your workbook. Or you could use Excel to play videos in …

Read morePlay Audio and Video in Excel
save chart as image

Save Chart as Image

November 30, 2018 by Philip Treacy

You might want to save your charts as images that can then be used in other applications, like email or displayed on a website. Selecting a single image then copying/pasting or saving it, isn't too much bother. But if you want to do that for several images it quickly becomes tiresome. I've written some VBA, …

Read moreSave Chart as Image
  • Previous
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Interim pages omitted …
  • Go to page 9
  • Next
  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
 
  • About My Online Training Hub
  • Contact
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Copyright © 2023 · My Online Training Hub · All Rights Reserved

Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.