• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microsoft Excel Tips and Tricks - Computergaga

  • Home
  • Excel Online Courses
  • Excel Functions List
  • Free Downloads
  • Blog
  • Tutorials
  • About
Home / Archives for VBA

Format Specific Words in a Cell using VBA

In this blog post, we look at how to create a macro that will look in a list and format all the instances of specific words that appear in a cell.

This macro is case sensitive and will also only apply the formatting if it is the whole word. For example, if you are formatting all instances of the word ‘red’, this macro will not format it if used in words like ‘reddish’ and ‘sacred’.

The macro uses a For Each Next loop to work on the range of cells selected by a user.

The Characters property has been used to apply the formatting to only specific words in a cell. In order to work, the Characters property will need the position of the first character of the word, and also how many characters to format.

The InStr function was used to find the first character of the word, or words, in each cell.

A Do loop is used to check the whole cell so if the word occurs multiple times in a cell, each instance is formatted.

Here is the complete Excel VBA macro code used.

[Read more…] about Format Specific Words in a Cell using VBA

Add Your Own Function to the Status Bar in Excel

When a range of cells are selected, Excel automatically displays formula results on the status bar. This can be an incredibly useful feature of Excel, especially when combined with filtering data.

Excel can display the sum, average, max, min, count of cells containing values and count of cells that are not blank in the status bar.

Formulas shown on the Status Bar in Excel

This blog post, looks at how you can get Excel to display your own function on the status bar. For example, you may need to know the median or mode value, or count the number of blanks in the selected range.

In this post, we will get Excel to display the number of blank cells in the selected range on the status bar.

[Read more…] about Add Your Own Function to the Status Bar in Excel

Animate a Chart in Excel

Animate a chart in Excel to create a cool effect for your charts. You will see the chart build itself in front of your very eyes.

The chart can be created in the usual way and then VBA is used to create the animation effect.

In this example a combo box is used to provide a way for the user to select the chart they want to see. The chart then gradually appears one data point at a time.

[Read more…] about Animate a Chart in Excel

Create a Hangman Game in Excel

I created a hangman game using Excel VBA for fun, and thought I would post it here for all budding Excel VBA learners to look at.

I find creating games, quizzes and sports spreadsheets an enjoyable way of keeping my Excel skills fresh, and to develop them further.

The game asks you to guess a letter to complete the phrase. A hint is provided for a little help, and the phrase will be related to music, sports, people, film or geography.

The spreadsheet is unprotected so you can check out the code and play around it with it further.

The VBA used to create this hangman game includes;

  • Dynamic arrays.
  • Creating a userform.
  • Module scoped variables.
  • Lots of text work including functions such as Left and StrConv.
  • Lots of For Loops, IF statements and a Select Case statement.

Download the Excel Hangman game

I also have a special Christmas version of my Hangman game in Excel to download.

Hangman game in Excel

In modern version of Excels, when downloading macro enabled spreadsheets, you will often need to unblock the files to allow the macros to run.

Do this by;

  • Locate the Excel file on your computer (probably the Downloads folder).
  • Right-click on the file and click Properties.
  • Check the Unblock box and click OK.

Let me now how you do? I want to see some high scores ?

Want to improve your Excel VBA skills? All the techniques used to create this hangman game are covered in our Excel VBA course.

[Read more…] about Create a Hangman Game in Excel

Separate Text into Different Cells

A common requirement in Excel is the need to separate text into different cells. The reasons for this are numerous, but typically it is because the way the data was imported or received is not sufficient for your analytical needs.

This tutorial looks at four techniques for separating text.

  • Using Text to Columns to separate text
  • Extract name from an email address
  • Extract text between two characters
  • Separating a number from text
[Read more…] about Separate Text into Different Cells
  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Go to Next Page »

Primary Sidebar

Recent Posts

  • Excel SWITCH Function – Nested IF Function Alternative
  • Sum Formulas Only in Excel
  • How to Calculate Age in Excel
  • Custom Sort in Excel
  • Case Sensitive Lookup with XLOOKUP in Excel
Advanced Excel Success book

Footer

Contact

[email protected]

LinkedIn Twitter YouTube

Useful Links

  • Home
  • Excel Online Courses
  • Tutorials
  • Sitemap
  • Privacy Policy
  • Jobs by Jooble

Course Topics

  • Blog
  • Charts
  • Courses
  • Dashboards
  • Downloads
  • Excel Tips
  • Formulas
  • Mail Merge
  • Office
  • PivotTables
  • Power BI
  • Power Pivot
  • Power Query
  • VBA

Join Our Mailing List

© Copyright 2009 Computergaga · All Rights Reserved ·