+ Reply to Thread
Results 1 to 7 of 7

'Alt+' Macro Question

  1. #1
    Registered User
    Join Date
    10-16-2014
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    11

    'Alt+' Macro Question

    I know it's possible and I've read a few different ways to go about it but I can't seem to get them to work.
    What I'm trying to do is run an 'Undo' function whenever I hit Alt+'Left Arrow key'
    Even if it's just Ctrl+z is ran when I hit Alt+'Left Arrow key' I'm not picky.

    For some perspective, I have a macro button on my mouse that I set to, what the editing software that came with the mouse calls, "IE Back," and that's exactly what I want it to do. I was just hoping to figure out a way that when my excel window is selected, when I hit the macro "IE Back" button, it commands an edit undo function instead.
    To be honest I'm not sure if the "IE Back" button's code is actually written as Alt+'Left Arrow key' but that was my first assumption. If its not I can obviously just write a custom macro to my mouse replacing the pre-written "IE Back" macro.

    Anyway I'd appreciate any help or incite on the question and thanks.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: 'Alt+' Macro Question

    Hi,

    The following code will UNDO once. After the UNDO is executed the UNDO stack is apparently cleared.
    Please Login or Register  to view this content.
    The following article explains how to do multiple UNDOs. http://j-walk.com/ss/excel/tips/tip23.htm

    Lewis

  3. #3
    Registered User
    Join Date
    10-16-2014
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    11

    Re: 'Alt+' Macro Question

    So I have put this in a personal module and saved it but it's not working yet. Do I have to change the name or do something else first?

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: 'Alt+' Macro Question

    You have to run Macro EnableAltLeftArrowKey() to start it up.

    You can put the following in the ThisWorkBook Module of your file to automatically start it when the workbook is opened:
    Please Login or Register  to view this content.
    Lewis

  5. #5
    Registered User
    Join Date
    10-16-2014
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    11

    Re: 'Alt+' Macro Question

    Ok, yeah that's what I was afraid of. So I'd have to hit an assigned hotkey first to enable the macro, and it's not until then that I could use Alt+Left Arrow, correct?
    I have it in my VBAProject (Personal.xlsb) so I believe it applies to all workbooks. So would I insert the "Option Explicit...." code at the start of the original code (before "Sub EnableAltLeftArrowKey()..."), or would I put it the "Sub EnableAltLeftArrowKey()..." in between "Private Sub Workbook_Open" and "Private Sub Workbook_BeforeClose(Cancel As Boolean)"

    Sorry, I took C++ as a Freshman in College so I can for the most part follow someone else's written code, not the best at writing it without help, but I obviously struggle at implementing it the most.

  6. #6
    Registered User
    Join Date
    10-16-2014
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    11

    Re: 'Alt+' Macro Question

    Oh.. I didn't read when you said ThisWorkBook right. My brain just "in ThisWorkBook" thinking you were referring to whatever the name of my workbook is, instead of "in the ThisWorkBook"..

  7. #7
    Registered User
    Join Date
    10-16-2014
    Location
    Minnesota
    MS-Off Ver
    2013
    Posts
    11

    Re: 'Alt+' Macro Question

    So I got the Alt+Left Arrow to work, unfortunately that must not be how CoolerMaster writes their "IE Back" program in their mice software..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Dumb question about macro Over macro
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-03-2014, 03:48 PM
  2. Excel Macro Question Box - goto different parts of the Macro
    By krishatherley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-19-2009, 09:12 AM
  3. Replies: 12
    Last Post: 05-24-2007, 02:18 PM
  4. macro question and count question... thanks!
    By bstaff in forum Excel General
    Replies: 5
    Last Post: 02-07-2007, 10:12 AM
  5. Macro Question
    By Josiah in forum Excel General
    Replies: 1
    Last Post: 01-28-2005, 11:49 AM

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