Thursday, October 28, 2010

En, Em, Eh, What?

There are different types of dashes: hyphen, en dash, and em dash. What is the difference between them?

Hyphen (-): This is the width of one digit. It is used to hyphenate words that break across a new line, or to join compound words. Ex. My, this professor is long-winded.

En Dash (–): This is the width of the letter 'n'. It is used to indicate a range of values. Ex. I will be on vacation from November 6–10.

Em Dash (—): This is the width of the letter 'w'. This is used to indicate a break in thought. Ex. I was eating pizza—and what a good pizza it was—with all my favorite toppings.

Using courier font we can get a better idea of the widths:
0 n m
- – —
[Sources: Fonts.com and Wikipedia]

Tuesday, October 12, 2010

Excel Macro for Background Color


I was writing an Excel Macro and I needed to set the background color of a cell based on the text value. To do this I wanted to use Conditional Formatting, and I found out that you cannot (AFAIK) setup Conditional Formatting from inside of a macro. But, you can create a macro that loops through a range and sets the formatting.

Here is how:
  1. Open the VB editor (Alt + F11)
  2. Open ThisWorkbook under Microsoft Excel Objects
  3. Add the following code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Set myRange = Range("C4:C104")
    For Each Cell In myRange
        If Cell.Value = "n" Then
            Cell.Interior.ColorIndex = 3
        End If
    Next
End Sub

Anytime  a change is made to the workbook, the macro is called. It checks a range of cells, and then if the text is 'n' it sets the background color to 3. But what is '3'?

Thursday, August 19, 2010

Break Types

Different types of breaks may be inserted with the following macro command:

Selection.InsertBreak Type:={type}

where {type} is one of:
  • wdPageBreak
  • wdColumnBreak
  • wdSectionBreakNextPage
  • wdSectionBreakContinuous
  • wdSectionBreakEvenPage
  • wdSectionBreakOddPage
  • wdLineBreak

[Source WordTips]

Sunday, August 15, 2010

Ready, Set, No-Go

You were supposed to leave work 15 minutes ago but you squeezed in some last minute details and now you want to run. So, you save & close your applications, and then click shutdown on your fancy new laptop with Windows 7. You jump up and get ready to run, but then you see the dreadful message:

Do not unplug your machine
Installing update 1 of 15 ....

Now what? You sit and wait 20 minutes while it installs, looking at your watch every minute. Isn't there some way around this? 

Actually there is. Instead of using the Shutdown from the start button, do this:
  1. Type Control-Alt-Delete
  2. In the bottom right corner then is a small power button. Click the arrow
  3. Choose Shutdown
The menu that opens gives you the option to Shutdown with Updates or just Shutdown.

[Source: MyTechGuide]

Monday, August 2, 2010

The Path

Here is a handy shortcut that I just found out about:

Under Windows 7, if you need to copy the path to a file, you just hold the Shift key, then right mouse click on the file. The menu that opens now has a new menu item in the middle called "Copy as path". You can then use Paste to put the full path where ever you like.