+ Reply to Thread
Results 1 to 7 of 7

Setting function keys

Hybrid View

thegrandmaster Setting function keys 12-05-2013, 10:27 AM
Alf Re: Setting function keys 12-06-2013, 10:19 AM
thegrandmaster Re: Setting function keys 12-06-2013, 02:14 PM
Alf Re: Setting function keys 12-07-2013, 04:31 PM
thegrandmaster Re: Setting function keys 12-08-2013, 03:21 AM
Kamal Asharaf Re: Setting function keys 12-08-2013, 07:54 AM
Alf Re: Setting function keys 12-08-2013, 10:02 AM
  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    5

    Setting function keys

    hi,

    Does anyone know how to set a multiple permanent function keys?

    Ex. if i want to assign F6 for making the cell text red and F7 for making the cell text green?

    Thanx

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Setting function keys

    Perhaps this could be of help?

    http://www.youtube.com/watch?v=Ys2XX4qhS7k

    Alf

  3. #3
    Registered User
    Join Date
    12-03-2013
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Setting function keys

    Thanx for trying, but i could not understand it. Will have to see if a similar english version is available.

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Setting function keys

    Sorry about that, but I assumed since your location is India that the youtube video would be ok.

    One way you can do it is as follows right click on a sheet tab. Then click on "View Code". In the new windows that opens paste the following code

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
     Application.OnKey "{F6}", "Set_Red"
     Application.OnKey "{F7}", "Set_Green"
    
     End Sub
    Then you need to go to the "Developer" tab and click on "Visual Basic". In the VB windows that opens click "Insert" and then click "Module" then paste the two pieces of code in the module window.

    Sub Set_Red()
    ActiveCell.Font.Color = -16777024
    End Sub
    
    Sub Set_Green()
    ActiveCell.Font.Color = -11489280
    End Sub
    The "Private Sub" will activate the "Set_Red" macro when you press F6 or "Set_Green" if you press F7. As both this macros are keyed to the active cell the font color will change in this cell so if you wish to type and change font color after pressing "Enter" I suggest you go to "Options" select "Advanced" and under "Editing Options" untick box marked "After pressing Enter, move selection". This way you ensure that the active cell is the one you just made an input to.

    Alf

  5. #5
    Registered User
    Join Date
    12-03-2013
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Setting function keys

    Thanx man. That helped

  6. #6
    Registered User
    Join Date
    06-12-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    86

    Re: Setting function keys

    useful stuff, well explained by u sir.

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Setting function keys

    Hi thegrandmaster!

    Thanks for feedback and rep!

    Hi Kamal

    Thanks for feedback and pleased to hear you found this useful.

    Alf

+ 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. Function Keys with Userforms
    By Gordon@work in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-22-2012, 04:30 PM
  2. Shortcuts of the Function Keys
    By shanew in forum Access Tables & Databases
    Replies: 3
    Last Post: 04-14-2009, 04:43 AM
  3. Setting Shortcut Keys
    By Conan Kelly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2006, 02:45 PM
  4. Using function keys in macros
    By Tha BeatMaker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-19-2005, 02:56 PM
  5. [SOLVED] How can I fix the function of the arrow keys?
    By 1Tochacek in forum Excel General
    Replies: 2
    Last Post: 02-09-2005, 03:06 PM

Tags for this Thread

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