Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / productivity / Office

Upside down text in MS Excel

2.14/5 (7 votes)
12 Oct 2007CPOL1 min read 1   316  
A way to get upside down text with data from another cell.

Introduction

Here is a different way of getting upside down text in Excel. It uses WordArt to show the text from any cell upside down.

Screenshot - upside_down_text_excel.gif

Background

Some times at work, we get into situations where we need to get some peculiar things done. This was one such for me.

Using the Code

Create a WordArt in Excel and then right click it, select Format WordArt, and change it to look like almost simple plain text. Rotate it 180 degrees, and make it upside down.

Then, open the Visual Basic Editor in MS Excel by using Alt+F11, and enter in the code by double clicking the sheet in which you have the WordArt inserted.

VB
Private Sub Worksheet_Change(ByVal Target As Range)
    Shapes(1).TextEffect.Text = Cells(1, 1)
    Shapes(1).Width = Len(Cells(1, 1)) * 6.5
End Sub

Explanation

The code does two things:

  1. Take the text in the cell (Row 1, Column 1) and set the WordArt's text to be the same.
  2. Then, adjust the width of the WordArt according to the string length of the text.

The Width adjustment code presently works fine for numbers. I wanted to show only numbers upside down. Please change the multiplier accordingly for other fonts and letters.

Points of Interest

The Width adjustment part can be improved by analysing more and getting a more accurate width. This is just a newbie's way to solve peculiar problems :-)

History

  • First version submitted on 13/10/2007.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)