Macro's with Ctrl or Ctrl-Shift?

When you record a new macro it asks you what Ctrl key you want to access it 
with.  If you Edit the Properties of a Macro it asks you what Ctrl-Shift key 
you want to use to access a macro.  How can you have more control over this 
to assign the proper key to a macro?  Thanks.



0
albert3569 (90)
9/5/2005 2:06:38 AM
excel 39879 articles. 2 followers. Follow

6 Replies
308 Views

Similar Articles

[PageSpeed] 32

Al,

I don't know what you mean by "edit the properties of a macro."  You can 
assign a Ctrl or Ctrl-Shift combination (excluding number keys) to macros 
either when about to record a macro, or later with Tools - Macro - Macros - 
Options.  If by "have more control," you mean keys other than Ctrl or 
Ctrl-Shift combinations, you can't assign a macro directly, but you can use 
the Application.Onkey method to assign pretty much any key or key 
combination to run a macro.
--
Earl Kiosterud
www.smokeylake.com

"Al Franz" <albert@nospam.netmation.com> wrote in message 
news:OLgg05bsFHA.2076@TK2MSFTNGP14.phx.gbl...
> When you record a new macro it asks you what Ctrl key you want to access 
> it with.  If you Edit the Properties of a Macro it asks you what 
> Ctrl-Shift key you want to use to access a macro.  How can you have more 
> control over this to assign the proper key to a macro?  Thanks.
>
>
> 


0
someone798 (944)
9/5/2005 5:59:59 AM
>> You can assign a Ctrl or Ctrl-Shift combination (excluding number keys) 
>> to macros either when about to record a macro, or later with Tools - 
>> Macro - Macros - Options.

Under Macro Options it seems that you can only assign Ctrl.  Ctrl is shown 
and grayed out, you can only change the letter.  How can you assign 
Ctrl-Shift from this menu.  Sorry I wasn't more clear, thanks.

"Earl Kiosterud" <someone@nowhere.com> wrote in message 
news:O4fNP8dsFHA.1168@TK2MSFTNGP11.phx.gbl...
> Al,
>
> I don't know what you mean by "edit the properties of a macro."  You can 
> assign a Ctrl or Ctrl-Shift combination (excluding number keys) to macros 
> either when about to record a macro, or later with Tools - Macro - 
> Macros - Options.  If by "have more control," you mean keys other than 
> Ctrl or Ctrl-Shift combinations, you can't assign a macro directly, but 
> you can use the Application.Onkey method to assign pretty much any key or 
> key combination to run a macro.
> --
> Earl Kiosterud
> www.smokeylake.com
>
> "Al Franz" <albert@nospam.netmation.com> wrote in message 
> news:OLgg05bsFHA.2076@TK2MSFTNGP14.phx.gbl...
>> When you record a new macro it asks you what Ctrl key you want to access 
>> it with.  If you Edit the Properties of a Macro it asks you what 
>> Ctrl-Shift key you want to use to access a macro.  How can you have more 
>> control over this to assign the proper key to a macro?  Thanks.
>>
>>
>>
>
> 


0
albert3569 (90)
9/5/2005 8:47:06 PM
Earl,

I think I see now, it depends if you have a lower case or upper case letter 
and it picks Ctrl or Ctrl-Shift.  Could you explain the "OnKey Method" a bit 
more, searched help but did not find anything.

Thanks.

"Earl Kiosterud" <someone@nowhere.com> wrote in message 
news:O4fNP8dsFHA.1168@TK2MSFTNGP11.phx.gbl...
> Al,
>
> I don't know what you mean by "edit the properties of a macro."  You can 
> assign a Ctrl or Ctrl-Shift combination (excluding number keys) to macros 
> either when about to record a macro, or later with Tools - Macro - 
> Macros - Options.  If by "have more control," you mean keys other than 
> Ctrl or Ctrl-Shift combinations, you can't assign a macro directly, but 
> you can use the Application.Onkey method to assign pretty much any key or 
> key combination to run a macro.
> --
> Earl Kiosterud
> www.smokeylake.com
>
> "Al Franz" <albert@nospam.netmation.com> wrote in message 
> news:OLgg05bsFHA.2076@TK2MSFTNGP14.phx.gbl...
>> When you record a new macro it asks you what Ctrl key you want to access 
>> it with.  If you Edit the Properties of a Macro it asks you what 
>> Ctrl-Shift key you want to use to access a macro.  How can you have more 
>> control over this to assign the proper key to a macro?  Thanks.
>>
>>
>>
>
> 


0
albert3569 (90)
9/5/2005 8:56:17 PM
Hold the shift key when you type in your letter.

(The dialog will change to display ctrl-shift to give you some feedback.)

(That one is gonna hurt, huh?)

Al Franz wrote:
> 
> >> You can assign a Ctrl or Ctrl-Shift combination (excluding number keys)
> >> to macros either when about to record a macro, or later with Tools -
> >> Macro - Macros - Options.
> 
> Under Macro Options it seems that you can only assign Ctrl.  Ctrl is shown
> and grayed out, you can only change the letter.  How can you assign
> Ctrl-Shift from this menu.  Sorry I wasn't more clear, thanks.
> 
> "Earl Kiosterud" <someone@nowhere.com> wrote in message
> news:O4fNP8dsFHA.1168@TK2MSFTNGP11.phx.gbl...
> > Al,
> >
> > I don't know what you mean by "edit the properties of a macro."  You can
> > assign a Ctrl or Ctrl-Shift combination (excluding number keys) to macros
> > either when about to record a macro, or later with Tools - Macro -
> > Macros - Options.  If by "have more control," you mean keys other than
> > Ctrl or Ctrl-Shift combinations, you can't assign a macro directly, but
> > you can use the Application.Onkey method to assign pretty much any key or
> > key combination to run a macro.
> > --
> > Earl Kiosterud
> > www.smokeylake.com
> >
> > "Al Franz" <albert@nospam.netmation.com> wrote in message
> > news:OLgg05bsFHA.2076@TK2MSFTNGP14.phx.gbl...
> >> When you record a new macro it asks you what Ctrl key you want to access
> >> it with.  If you Edit the Properties of a Macro it asks you what
> >> Ctrl-Shift key you want to use to access a macro.  How can you have more
> >> control over this to assign the proper key to a macro?  Thanks.
> >>
> >>
> >>
> >
> >

-- 

Dave Peterson
0
petersod (12004)
9/5/2005 8:58:37 PM
Al,

The OnKey method is something that runs in a macro.  It's run once, and 
assigns any key (This, that, Shift-this, Ctrl-Shift-that, Alt-other etc) to 
run a macro when the key is pressed.  Here are some things to consider 
before we get into the coding:

Once in effect, it causes the key to run the macro in any open workbook in 
the instance of Excel that's running.  It's Excel-wide, not just 
workbook-wide.  You can code around it, but it gets a bit tiresome.

It remains in effect after the workbook has been closed, unless the workbook 
also contains code to reset it when closed.  If the workbook has been 
closed, pressing the key will cause the workbook to open.

You can't use the key as the first character to be typed into a cell.  It 
will trigger the macro instead.  You can use it once typing in a cell, and 
can get around this first character problem by pressing F2 or 
double-clicking the cell to first get into Edit mode.

To implement this, you'll need to be able to move about the Visual Basic 
Environment (Alt-F11).  David McRitchie has a tutorial to get you started 
with that.

If you're still interested, post back.  We'll give you some code.  It isn't 
all that much, actually.
--
Earl Kiosterud
www.smokeylake.com

"Al Franz" <albert@nospam.netmation.com> wrote in message 
news:uC7LdwlsFHA.4052@tk2msftngp13.phx.gbl...
> Earl,
>
> I think I see now, it depends if you have a lower case or upper case 
> letter and it picks Ctrl or Ctrl-Shift.  Could you explain the "OnKey 
> Method" a bit more, searched help but did not find anything.
>
> Thanks.
>
> "Earl Kiosterud" <someone@nowhere.com> wrote in message 
> news:O4fNP8dsFHA.1168@TK2MSFTNGP11.phx.gbl...
>> Al,
>>
>> I don't know what you mean by "edit the properties of a macro."  You can 
>> assign a Ctrl or Ctrl-Shift combination (excluding number keys) to macros 
>> either when about to record a macro, or later with Tools - Macro - 
>> Macros - Options.  If by "have more control," you mean keys other than 
>> Ctrl or Ctrl-Shift combinations, you can't assign a macro directly, but 
>> you can use the Application.Onkey method to assign pretty much any key or 
>> key combination to run a macro.
>> --
>> Earl Kiosterud
>> www.smokeylake.com
>>
>> "Al Franz" <albert@nospam.netmation.com> wrote in message 
>> news:OLgg05bsFHA.2076@TK2MSFTNGP14.phx.gbl...
>>> When you record a new macro it asks you what Ctrl key you want to access 
>>> it with.  If you Edit the Properties of a Macro it asks you what 
>>> Ctrl-Shift key you want to use to access a macro.  How can you have more 
>>> control over this to assign the proper key to a macro?  Thanks.
>>>
>>>
>>>
>>
>>
>
> 


0
someone798 (944)
9/5/2005 9:23:15 PM
"Earl Kiosterud" wrote...
....
>Once in effect, it causes the key to run the macro in any open
>workbook in the instance of Excel that's running.  It's Excel-wide,
>not just workbook-wide.  You can code around it, but it gets a bit
>tiresome.
....

It only requires using a global variable holding a table of keys and 
corresponding applicable objects in order to limit the scope of OnKey. Each 
macro called by OnKey would need to start with code that calls a common 
function subroutine to check whether the current active object has an entry 
for the key(s) pressed, if so return immediately with a value indicating to 
the calling routine that it should proceed; otherwise, use SendKeys to send 
the key combination to Excel and return another value to the calling routine 
indicating it should exit immediately. Basic table-driven programming. 


0
hrlngrv (1990)
9/5/2005 9:48:31 PM
Reply:

Similar Artilces:

Macro warning with no macros
I have a workbook that when I try to open it I get the warning tellin me it contains macros and asking whether I want to Enable or Disabl them. I put no macros, no VB scripts, nothing at all in the workboo other than standard Excel formulas and some charts. I developed it i Excel 2002, SP-2, but have moved it back and forth between tw computers, the other which has Excel 97. Regardless of whether Enable or Disable or change the security settings so as not to get th warning, once the workbook is open even if I go t Tools-Macro-Macros... it lists no macros. How can I find out what's cau...

Macro
Can anybody tell me how to kick off a macro automatically as file is opened? Regards ...

Macro
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: intel Hi, I'm thinking of buying Mac: Office 2008, but before I do I want to check that I will be able to download Scritpsmart collection of templates without any glitches: <http://www.bbc.co.uk/writersroom/scriptsmart/faq.shtml> Does anyone know if I can do this? Regards, SP. In article <ee98ff5.-1@webcrossing.caR9absDaxw>, StregaItalia@officeformac.com wrote: > Version: 2008 > Operating System: Mac OS X 10.4 (Tiger) > Processor: intel > > Hi, > > I'm thinking of buying Mac: Of...

Run macro automatically.
How do I make a macro run automatically when a worksheet it is attached to is loaded? right click on the sheet tab>view code>left window worksheet>right window activate -- Don Guillett SalesAid Software donaldb@281.com "Excel macro" <Excel macro@discussions.microsoft.com> wrote in message news:DD7AF1E3-9263-4523-AC49-A43ABA1AB9D0@microsoft.com... > How do I make a macro run automatically when a worksheet it is attached to is > loaded? I am unable to find "activate " when I right click on worksheet. ( i assume that you are referring to the windo...

Attached Toolbars Macros
Excel 2003 I have a custom tool bar, this tool bar has several items, each item is pointing to a VBA code. This tool bar is attached to the worksheet. I've copied this spreadsheet to several computers. After I copied the spreadsheet I decided to rename the spreadsheet, after I renamed the spreadsheet the Toolbar Item's macros were still pointing to the old name, I reasigned each tool bar item to the current spreadsheet, saved the spreadsheet and everything was working on my computer, but when I re-copied the new spreadsheet to other computers and I clicked on the Toolbar Item...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Protected sheets and running macros
i have a sheet with a macro ran by a normal button at the top. Howeve when i protect the worksheet where ever i click on the sheet the macr executes. Can any one offer any advice on how to stop this? Thanks Robert -- Message posted from http://www.ExcelForum.com hi, i am not able to reproduce the problem, hence i may not be able t provide a panacea for that issue. here is what i suggest. i have a sheet that has a macro that is run when a control toolbo button (that is, not a form button) is clicked. this sheet is protected based on the user logged in. what i have don is to protect t...

??? Ctrl Shilft End function is disabled
For some reason, the Ctrl+shift+end function in my excel is no longer available. Would appreciate advice how I can reactivate this keyboard shortcut. -- Thanks a million for your time and expert advice :-) Jaylin *****Jaylin Message ended******* CTRL+Shift+End does not work in Shared Workbooks. Perhaps that is the cause? Jaylin wrote: > For some reason, the Ctrl+shift+end function in my excel is no longer > available. Would appreciate advice how I can reactivate this keyboard > shortcut. Is this done to terminate worksheet re-calculations or to end macros that are running...

Macro to remove rows?
Hi, I receive thousands of rows of data from an extract that comes from a database. The data extract automatically generates page headers that need to be removed, and I would love to automate this process. The headers do have a pattern to them, but I'm not clever enough to figure out a good way to use that to write a macro. The first row of the header starts with hyphens ------------------------------- Then there's a variable number of rows of header data to delete followed by another row of hyphens ------------------------------- Then 2 additional rows that must be deleted. The nu...

Macro Freezes Reading Pane
I have a macro that Sends/Receives Tasks from Project Server into Outlook Tasks. Everything is working fine, except one weird thing that happens. I have the Timer set on the macro and it starts as soon as Outlook starts. The macro gets the tasks from ProjectServer every hour. As soon as the macro starts running the Reading pane freezes in the Inbox. If i stop the macro then Reading pane is back to normal. Can anyone please tell me if there is something I can do in VBA to fix this annoying issue. Thanks a lot ...

Calling on a macro within a macro!
Hey All!! Quick Question - How do you call up a macro within a current macro? I have one big macro and I need it to jump to several other macros when it runs! Does it matter where the other macros are stored or is it better to have them all in one module? Help appreciated Thnx! Hi Mellowe, '=============>> Public Sub Main() 'Your code Call One 'your code End Sub '<<============= '=============>> Public Sub One() MsgBox "Hi from One" End Sub '<<============= > Does it matter where the other macros are stored or ...

Top margin shifts when viewed in print preview
This happened in Pub 97. Just installed Pub 2003, same thing. An 8.5 x 11 landscape page with margin guides all set at .2 inches (for Minolta 3300), also vertical and horizontal ruler guides and grid guides set at 2 columns and rows spaced at .4 inches. The same graphic is in each quadrant filling the bordered area. (Four postcards with an even border when the page is cut into quarters). Looks great until I view the print preview or print it, then it views and prints with a top margin of 6mm or about .25 inch. I don't think it's my printer properties, as I have printed it ...

Processing Ctrl+Tab in a dialog box with CTabCtrl
I wanted a tab dialog box, but without OK, Cancel and Apply buttons so I used CTabCtrl instead CPropertySheet. The problem is that Ctrl+Tab now doesn't work as expected. Ctrl+Tab acts like Tab changing the focus from one control to another instead switching between tabs. I tried to write OnKeyDown handler for my modal dialog box, but it seems that WM_KEYDOWN message is processed before it reaches my handler. Please help. You can do the key combination checking in PreTranslateMessage of your dialog. --------- Ajay Kalra ajaykalra@yahoo.com ...

shortcut keys to macros
Hi, Is it at all possible to assign shortcut keys to macros in Outlook? Thx, Hans ...

Macro that password protects a sheet
I am attempting to create a macro that can open a protected sheet, change something, and then protect it again. I continue to have an issue with the macro not entering the password. Is this possible to do/fix? Thanks, Ryan ..open password="mypassword" -- Don Guillett SalesAid Software donaldb@281.com "Ryan" <Ryan@discussions.microsoft.com> wrote in message news:D4780ED8-CA1D-4284-97BC-3576160D998E@microsoft.com... > I am attempting to create a macro that can open a protected sheet, change > something, and then protect it again. I continue to have an iss...

help Unable to record Macro !!!!!!!
I want to record a macro in excel.But as soon as I click record Macro it says "unable to record" macro. Got no help in excel help.I do this same thing in word and it's working. Please help It's urgent for me !!!1 Have a look here http://groups.google.com/groups?as_epq=unable%20to%20record&as_ugroup=microsoft.public.excel.* -- Don Guillett SalesAid Software donaldb@281.com "ash" <anonymous@discussions.microsoft.com> wrote in message news:3e0b01c42ae5$45333e00$a401280a@phx.gbl... > I want to record a macro in excel.But as soon as I click > record...

Footer Macro?
Hi Months ago I read a Public Sub Macro that read the selection of a drop down list in a combo box and placed it in the center Footer at the same time it also placed the date in the right Footer and tme in the left footer. I have searched most of the regular sites including this one and cannot find it anywhere --- Can anyone help with my search. Any help much appreciated Cheers ---- Mully ...

Keyboard Shortcut in Macro
Hi all i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it to Ctrl+z how can i do it . regards Tools-->Macro-->Macros. Select (don't open!) your macro, and hit the Options button. :) ************ Hope it helps! Anne Troy www.OfficeArticles.com "osaka78" <osaka78@discussions.microsoft.com> wrote in message news:1721A458-212D-4446-8209-494A459EE428@microsoft.com... > Hi all > i'v created macro with Keyboard Shortcut Ctrl+b . now i want to change it > to > Ctrl+z > how can i do it . > > regards THE MACRO IS NO...

Macros have been disabled but there is no macro
when I open a specific doc the info bar at the top says "Macros have been disabled", but when I hit Alt+F11 I can't find any VB or a module to remove. Why is it telling me about macros? Other docs don't give me this prompt. I thought I might have to enable macros to see the code. When I enabled macro, it said "do you want to save changes to this doc?" it flickered and came back as if immediately reopened. Any ideas? I could copy and paste the text into a new doc but I'd be interested to be able to strip off this problem. The doc is an internal IT ...

Run multiple Macros or macros from within other macros ?
I would like to run multiple macros at startup. What code should be used in the Private Sub Application_Startup command in the ThisOutlookSession area ? If the names of my macros were below what would the code to look like ? Macro1 Macro2 Macro3 I have looked at the samples from previous posts and cannot determine how to make them apply specifically to my needs. In Excel you can use the Run "Macro1" line and it would run that macro. Run does not work in Outlook I suppose because I kept getting an error. **** Also - What code is needed to execute a macro from w...

Startup macro
Is it possible for automatic start of macro in moment when excel file is opening. I mean when I open excel file specific macro will be immediately automatic started. Zeno option explicit sub auto_Open() call yourspecificmacronamehere end sub Zeno wrote: > > Is it possible for automatic start of macro in moment when excel file is > opening. > I mean when I open excel file specific macro will be immediately automatic > started. > > Zeno -- Dave Peterson ...

Macro Question #8
Hi: I have a group of several files with a simple macro that automatically goes to a specific worksheet at the time the file is opened. The code is as follows: Private Sub Workbook_Open() Worksheets ("TITLE").Select Range ("a1").Select End Sub The macro works properly when a single file is opened, but when I try to open several of the files at the same time I get the following error message: Run Time Error 1004 Select method of Worksheet Class Failed All of the files do open, but the macro appears to run on only the first file selected. All of the other files open ...

macros #29
I am trying to remove dup rows in an excel spreadsheet, but my macro only deletes the dup out of the first column, not the whole row and moves up the next item to replace what it deleted. Any suggestions post the macro here. --- Message posted from http://www.ExcelForum.com/ It's easier to work from the bottom towards the top (just in case you're not doing it now). And you can do this kind of thing to get rid of a row: rows(i).delete cells(i,1).entirerow.delete But it's difficult to guess without seeing your code. Dorothea wrote: > > I am trying to remove dup ro...

MACRO AUTORUN
HI EVRYONE, ON ONE OF MY EXCEL SHEETS I HAVE MACRO RUNNING. WHENEVER I OPEN THE FILE, IT SAID CLICK TO DISABLE OR ALLOW. I DID NOT ADD ANY MACRO, I CAN'T FIND ANY MACRO IN THE SPREAD SHEET (TOOLS, MACRO). IF I COPY PASTE AND SAVE ON ANOTHER DOCUMENT, SAME THING. IF I SEND TO A COLLEGUE AND OPENS IT, SAME BLOODY MACRO. HOW CAN I GET RID OF THIS MACRO. THANKS -- Chich See http://www.contextures.com/xlfaqMac.html#NoMacros -- HTH Bob Phillips (remove nothere from email address if mailing direct) "b52shut" <b52shut@yahoo.com> wrote in message news:9D2BF73D-4F4D-4F...

Where does Word 2007 keep my macros, toolbar customizations etc?
I have a new computer running Win 7 and it has Microsoft Office 2007. the computer had a RAID 1 configuration, which means a second disk was mirroring everything the main disk was doing. The main disk failed, and I for a number of reason i was force to do a fresh reinstall of Win7 and Office 2007 on a new main drive. I am now trying to migrate my data from disk 2 to disk 1. I have managed to copy over all my documents, which was straightforward. But i also to copy the macros, toolbar settings etc from 2 to drive 1, but i don't know what files i should be transferring. A...