LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Reset the macro assigned to Ctrl+F on workbook deactivate

Ctrl+f doesnt work when i open another new workbook not a new sheet in the
same workbook where i have the code. I have the code in my ThisWorkBook
module not in Sheet module.Hope i am clear now....

"Jim Cone" wrote:

"when i open some other excel sheet"

Do you mean "when I switch to another sheet" and not
"when I open another workbook" ?
If so your code belongs in the Sheet module of each sheet where
you want OnKey to work. The code would go in these subs ...

Private Sub Worksheet_Activate()
Private Sub Worksheet_Deactivate()
--
Jim Cone
Portland, Oregon USA



"swtupr"
wrote in message
Hi Jim,
Thanks for your reply.
Sorry there was a mistake when i pasted the code here.
Actually there is no "FindByValue" in my deactivate event. I gave the
exactly same way as you mentioned
Application.Onkey "^f"
But i am still facing the above mentioned problem. Am not able to figure out
wats wrong...




"Jim Cone" wrote:
This...
sub WorkBook_Deactivate()
Application.OnKey "^f", "FindByValue"
Application.OnKey "^F", "FindByValue"
End Sub

Should be...
sub WorkBook_Deactivate()
Application.OnKey "^f"
Application.OnKey "^F"
End Sub
--
Jim Cone
Portland, Oregon USA
(what is that little white box at the top right corner of the vbe?)




"swtupr"
wrote in message
I have an excel workbook where i have assigned an excel macro for the short
cut Ctrl+F as below:

Sub WorkBook_Activate()
Application.OnKey "^f", "FindByValue"
Application.OnKey "^F", "FindByValue"
End Sub

Public Sub FindByValue()
Application.Dialogs(xlDialogFormulaFind).Show,2,2 // to find by value
not formula
End Sub

And then i am trying to reset the ctrl+f functionality to normal in the
deactivate event as below:

sub WorkBook_Deactivate()
Application.OnKey "^f", "FindByValue"
Application.OnKey "^F", "FindByValue"
End Sub

The Ctrl+F working fine in my workbook where i have this code.
But when i open some other excel sheet and try to do a Ctrl+F
the find dialog box is not opened and nothing is happening .
Can i know why ctrl+f not working in other excel sheets and
can i get a solution for this issue please?????
Thanks.


 
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 do you reset the position that pressing CTRL-END moves you to? PeterB Excel Discussion (Misc queries) 2 October 10th 08 06:10 PM
Reset Ctrl+ Macro Shortcuts QNiehausen Excel Discussion (Misc queries) 0 July 15th 08 02:42 AM
My Ctrl+D doesn't work, how can I reset? mikenoble Excel Discussion (Misc queries) 3 March 17th 07 09:11 PM
CTRL+SHIFT+END extends selection of cells to last - how reset? LisaH Excel Discussion (Misc queries) 9 July 28th 06 01:36 PM
Copying a workbook with custom toolbar assigned to a macro Matt W Excel Discussion (Misc queries) 1 February 4th 05 10:46 PM


All times are GMT +1. The time now is 04:39 AM.

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

About Us

"It's about Microsoft Excel"