Results 1 to 12 of 12
  1. #1
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Font Point Size and Custom Keyboard Shortcuts (97sr2H)

    The Font Point-Size Increment and Decrement Toolbar buttons in XL97 both use the largest font point size of a selected area, and increment or decrement by one point. So if you have a mix of cells with say 4 12 point cells, 4 10 point cells and 16 8 point cells, and click the "decrease" button they -ALL- get set to 10 points. Has this changed with later versions of Excel?

    This behavior annoys me, as I wanted it to be more like Word, which increments or decrements each point size for every point size, so I wrote the following (simplified), and it's decrement counterpart:

    Sub FontPtIncr()
    Dim rngCell As Range
    For Each rngCell In Selection
    rngCell.Font.Size = rngCell.Font.Size + 1
    Next rngCell
    End Sub

    ... and attached them to the appropriate buttons. Now what I'd like to do is attach them to "Ctrl <" (Ctrl-shift-comma) and "Ctrl >" (Ctrl-shift-period), like Word, but it appears I can't. Any way to accomplish this?
    -John ... I float in liquid gardens
    UTC -7DS

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts

    Well, there's no change "all fits one size" font change behaviour in Excel 2000. Thank you for indirectly helping me discover that the macro shortcut keys are case-sensitive. (Ctrl + Q will call a different macro from Ctrl + q.) As for your original request, I can only suggest the alternative of adding the macros to one of your right-click menus. HTH
    Gre

  3. #3
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts (97sr2H)

    Likewise with 2002, I'm afraid.
    (I do note that the change takes the parameters of the first cell selected.)

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts (97sr2H)

    You are at least partly correct Leif, I didn't test all scenarios. I just tested one row of 8 point, followed by a row of 14 point, followed by a couple more rows of 8 point, and the built in decrement button doesn't do -anything-? Go figure. (BTW, I'm doing this all in my default Arial 10 point style)

    Now if only I can get my code to run faster over large ranges.
    -John ... I float in liquid gardens
    UTC -7DS

  5. #5
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts (97sr2H)

    I thought that Excel limited shortcut keys to the a-z, A-Z + ctrl keys. So is it the keyboard shortcut that is the problem.

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts (97sr2H)

    Exactly! For Office 2000 and Win 2000 I think the API permits trapping the Ctrl < & Ctrl > keystrokes but not before. Anyhow, it'll be a while before I return to the issue.
    -John ... I float in liquid gardens
    UTC -7DS

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts

    <For Office 2000 and Win 2000 I think the API permits trapping the Ctrl < & Ctrl > keystrokes>
    Have yet to achieve this on an Office 2K/Win 2K set-up. Is this an MSKB reference or a Newgroup reference which you have come across - presumably as an API call from within Office?
    Gre

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts

    Why not like this:

    Option Explicit

    Sub StartIt()
    Application.OnKey "^+>", "test"
    End Sub
    Sub test()
    MsgBox "control-shift->"
    End Sub
    Sub StopIt()
    Application.OnKey "^+>"
    End Sub
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  9. #9
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts

    Good point, but perhaps it needs to be: <pre>Sub Auto_Open
    Application.OnKey "^+.", ""
    Application.OnKey "^+.", "test"
    End Sub</pre>

    The Ctrl < and Ctrl > shortcuts default to Copy Down and Copy Left respectively. These need to be disabled before a new assignment can be made.
    Gre

  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts

    Control-shift-dot *is* control->

    So

    Onkey "^+>"

    has the same effect as

    Onkey "^+."
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  11. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts

    I was looking at this: WUI VKeys
    -John ... I float in liquid gardens
    UTC -7DS

  12. #12
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Font Point Size and Custom Keyboard Shortcuts

    Looks interesting. Thanks. As you can see, thanks to Jan Karel there seems to be a simple solution.
    Gre

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •