+ Reply to Thread
Results 1 to 5 of 5

How to make a macro that changes the parameters of a certain macro shortcut/hotkey?

  1. #1
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    How to make a macro that changes the parameters of a certain macro shortcut/hotkey?

    So i have a macro here designated on shortcut CTRL+E.

    When the user presses CTRL+E, certain values will enter in the cell ACTIVECELL.Offset(0, 4). But sometimes there are instances where i want it to be entered on ACTIVECELL.Offset(0,5) or (0,3) depending on the user.


    From what I heard there's a macro to edit a macro so i can edit the activecell.offset value as i wish, but they recommended not to do so. So as a workaround i will have plenty of Macros ready and the user just has to set the parameters.

    so in my code there will be:




    Please Login or Register  to view this content.
    So how can make it that the user can edit his shortcut of CTRL+E to do either option1, option2, option3?

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: How to make a macro that changes the parameters of a certain macro shortcut/hotkey?

    Hi, kjy1989,

    depending on the user.
    Really dependigng on the user and always or temportarily? Can you narrow the problem down to be dependent on the column in which the action should be taken?

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: How to make a macro that changes the parameters of a certain macro shortcut/hotkey?

    Hi,

    I will try my best to narrow it down so you can understand. I will do so by explaining the purpose of this macro. See this excel file our employees are using is designed so they will be faster in making their price quotations for our customers. And depending on the employee, they have different methods on how to make quotation. So for example that CTRL+E shortcut consists of a vlookup on a database that brings out a price to a designated cell, that cell designation dependent on how the employee does his quotation. So what i like is that the user can choose which cell to put his price whether it's located at Activecell.offset(0,2) , (0,3) or (0,4).

    So what im aiming for is something like a control panel window of some sort for the users:

    for example: Pressing ctrl+shift+e will open up a userform named "SET PARAMETERS".
    In here, a window will pop up asking him where he wants to designate his price column, he can choose either column B,C, or D. Once he chooses a column, the corresponding shortcut of CTRL+E changes to the corresponding macro (whether its option1, option2, or option 3).

    Of course, im not asking for the entire userform of the parameters, im just asking for a code that will make a certain hotkey change its macro designation. Like how to change ctrl+e to designate to the macro "option2" instead of "option1"

    I hope you understand as i have difficulties in explaining my situation because i find this very complicated to my standards. (im a vba beginner)

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: How to make a macro that changes the parameters of a certain macro shortcut/hotkey?

    Hi kjy1989,
    maybe something like this
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-03-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: How to make a macro that changes the parameters of a certain macro shortcut/hotkey?

    Ok, im trying it right now, im having a hard time understanding the application.inputbox line...

    I will let you know...

+ 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. shortcut/ hotkey Paste Special Transpose
    By chuckdee in forum Excel General
    Replies: 7
    Last Post: 01-07-2013, 07:59 PM
  2. Macro hotkey without CTRL?
    By blandow in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-14-2010, 08:12 AM
  3. Query Macro Hotkey
    By mesadw in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2009, 10:43 AM
  4. Macro works in VBA editor but not when run with hotkey
    By cambotb in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-02-2008, 02:20 AM
  5. [SOLVED] Global macro hotkey
    By Mikus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2005, 04:05 PM

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