+ Reply to Thread
Results 1 to 7 of 7

Keyboard shortcuts in VBA

Hybrid View

Yukio Keyboard shortcuts in VBA 04-10-2013, 04:22 AM
AndyLitch Re: Keyboard shortcuts in VBA 04-10-2013, 04:55 AM
Yukio Re: Keyboard shortcuts in VBA 04-10-2013, 06:14 AM
AndyLitch Re: Keyboard shortcuts in VBA 04-10-2013, 06:38 AM
Yukio Re: Keyboard shortcuts in VBA 04-10-2013, 07:14 AM
AndyLitch Re: Keyboard shortcuts in VBA 04-10-2013, 07:53 AM
mnjofra Re: Keyboard shortcuts in VBA 04-10-2013, 07:56 AM
  1. #1
    Registered User
    Join Date
    04-10-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    4

    Keyboard shortcuts in VBA

    Hello everyone,

    I would like to introduce a keyboard shortcut to a VBA function/macro, is that possible?

    Example of what should happen:
    I have a cell with a function name (COUNT) and I would like the function/macro to add the "=" in front of it and then recognize it as a function and automatically execute CTRL+SHIFT+A.

    "COUNT" + "=" is =COUNT -> "=COUNT" + "CTRL+SHIFT+A" + "'" is '=COUNT(value1,value2,...)


    Thanks in advance,
    Rob

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Keyboard shortcuts in VBA

    Sub ConvertCalc()
    
        Range("A1").Value = "=" & Range("A1").Value
        ActiveSheet.Calculate
        
    End Sub
    Elegant Simplicity............. Not Always

  3. #3
    Registered User
    Join Date
    04-10-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Keyboard shortcuts in VBA

    Awesome, but the CTRL+SHIFT+A part is sadly still missing.

    Thanks in advance,
    Rob

  4. #4
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Keyboard shortcuts in VBA

    Keyboard shortcuts tend to be a bit quirky... It's better to call directly whenever possible

  5. #5
    Registered User
    Join Date
    04-10-2013
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Keyboard shortcuts in VBA

    Quirky as in impossible or extremely difficult, but possible?
    If it's the latter, do you or anyone else know how it could look like, I can test it on my own until I get what I want.

    Thanks!

  6. #6
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Keyboard shortcuts in VBA

    SendKeys "^+{A}"
        DoEvents

  7. #7
    Registered User
    Join Date
    08-22-2012
    Location
    Zagreb, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: Keyboard shortcuts in VBA

    HI,
    you have to check format of this cell. If your format is "text", excel will not calculate nothing here. Change proper format to "general" or any kind of "numeric" and then call this macro.
    Regards,
    If a post helps press star sign 4 my reputation

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1