Archive for the ‘Keyboard’ Category

Macro keyboard shortcuts in Excel 2007

June 10, 2007

I’ve just written a new macro in Excel, and wanted to assign Ctrl-Shift-F to it, as it does some advanced finding. However, the Shortcut key field that appears in the Record Macro dialog and also in the Options… dialog opened from the Macros dialog, it seems to only be possible to assign Ctrl-<something> to a macro, and not Ctrl-Shift-<something>.

Disappointed, I choose Ctrl-E instead. Cursing Microsoft again for not putting a decent keyboard customization feature in Excel 2007 (and also in Outlook Editor), like they did in Word 2007.

But then I recalled that I already had a macro that copied the content of the selected cell, and I’m used to activate it using Ctrl-Shift-C. I want back to the Options… dialog and found out that although it says Ctrl+<something>, if you type Shift-<something> in that field, the Ctrl label changes to Ctrl+Shift.

I’d say that’s not the most discoverable feature I’ve seen…


The Macro I use for copying a cell (or cells) content is as follows:

Sub CopyCellContent()
    Dim MyData As DataObject
    Dim s As String
    Dim i As Long
    Set MyData = New DataObject
    If IsArray(Selection.Value) Then
        s = Selection.Cells(1).Value
        For i = 2 To Selection.Cells.Count
            s = s & ", " & Selection.Cells(i).Value
        Next i
        MyData.SetText s
        MyData.SetText Selection.Value
    End If
End Sub


Second rename command in Total Commander

May 7, 2007

I use Total Commander to manage my files. I find it invaluable. Today, I accidentally discovered a great feature it has which I was not aware of.

One of the nuisances of renaming a file is to remember to keep the extension, since when I enter the “inplace rename” mode, the entire filename can be edited, including the extension.

I just noticed that when I repeat the command that starts the “inplace rename” mode, only the filename without the extension is selected, which makes it very handy to rename the file while keeping the extension.

From my tests, this only works if you use the keyboard shortcut to start the “inplace rename” mode. By default it is Shift-F6. In my configuration, F2 also does the same thing, to be compatible with Windows Explorer. However, other methods to enter the “inplace rename” mode, such as clicking the report name twice or using File menu -> Basic File Handling -> Rename (Inline) doesn’t have this effect.

Searching some more, I noticed this is explicitly mentioned in the online help, in the “F6: Rename / Move” topic. It also mention another nice feature:

When renaming a ZIP file to an EXE file, Total Commander will ask if you want to create a self extracting ZIP archive. If you choose ‘yes’, the EXE file will be converted.