Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ryk Ryk is offline
external usenet poster
 
Posts: 36
Default Assign F1 as a macro?

I have made this from a old post, but it doesn't work, the help screen
comes up...any ideas why?

Option Explicit
Sub DownRow()
Range("G" & ActiveCell.row + 1).Select
End Sub
Sub F1On()
Application.OnKey "{f1}", "DownRow"
End Sub
Sub F1Off()
Application.OnKey "{f1}"
End Sub

Its modified from a Dave Pederson answer in another post.

Ryk

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Assign F1 as a macro?

It works for me. Did you run F1On before trying to use F1?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ryk" wrote in message
oups.com...
I have made this from a old post, but it doesn't work, the help screen
comes up...any ideas why?

Option Explicit
Sub DownRow()
Range("G" & ActiveCell.row + 1).Select
End Sub
Sub F1On()
Application.OnKey "{f1}", "DownRow"
End Sub
Sub F1Off()
Application.OnKey "{f1}"
End Sub

Its modified from a Dave Pederson answer in another post.

Ryk



  #3   Report Post  
Posted to microsoft.public.excel.misc
Ryk Ryk is offline
external usenet poster
 
Posts: 36
Default Assign F1 as a macro?


How do i run F1On? I thought macro did all the work?

Ryk

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Assign F1 as a macro?

Ryk

Works fine in my Excel 2003.

Where did you enter the code?

Does the macro DownRow work on its own?

All 3 should be placed into a General module.

F1On must be run first to set the F1 key to run DownRow macro.


Gord Dibben MS Excel MVP

On 16 Oct 2006 15:07:20 -0700, "Ryk" wrote:

I have made this from a old post, but it doesn't work, the help screen
comes up...any ideas why?

Option Explicit
Sub DownRow()
Range("G" & ActiveCell.row + 1).Select
End Sub
Sub F1On()
Application.OnKey "{f1}", "DownRow"
End Sub
Sub F1Off()
Application.OnKey "{f1}"
End Sub

Its modified from a Dave Pederson answer in another post.

Ryk


  #5   Report Post  
Posted to microsoft.public.excel.misc
Ryk Ryk is offline
external usenet poster
 
Posts: 36
Default Assign F1 as a macro?



Macro itself works fine, assigned it to a button.
How do i run F1On? I thought macro did all the work?

Ryk



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Assign F1 as a macro?

It does, but it has to be run somehow.

Either run it manually (ToolsMacroMacros..., select it from the list, and
hit Run.

or put it in the Workbook Open


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call F10Off
End Sub

Private Sub Workbook_Open()
Call F10On
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ryk" wrote in message
s.com...

How do i run F1On? I thought macro did all the work?

Ryk



  #7   Report Post  
Posted to microsoft.public.excel.misc
Ryk Ryk is offline
external usenet poster
 
Posts: 36
Default Assign F1 as a macro?


I added this....in the this workbook spot... modified it to be F1 not
F10.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call F1Off
End Sub


Private Sub Workbook_Open()
Call F1On
End Sub


Get sub or function not defined error.

  #8   Report Post  
Posted to microsoft.public.excel.misc
Ryk Ryk is offline
external usenet poster
 
Posts: 36
Default Assign F1 as a macro?


Ok Ok , seems I am not the brightest bulb, got confused, then it
dawned, run the F1On macro, to assign it heheh. Works awesome, thanks
guys.

Ryk

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create a command button, then assign macro to it in excel kshaheen Excel Discussion (Misc queries) 3 June 24th 08 01:03 PM
Assign Macro David Excel Worksheet Functions 1 October 9th 06 03:31 AM
I can't find the Assign Macro command Dave Excel Discussion (Misc queries) 3 September 27th 06 07:08 PM
Assign macro name to menu command w/o using workbook name Blight_Pete Excel Discussion (Misc queries) 0 August 3rd 06 10:48 PM
assign macro PH NEWS Excel Worksheet Functions 2 February 28th 06 02:17 PM


All times are GMT +1. The time now is 04:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"