Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So I created a few macros that run on shortcut keys. Somehow, I moved them
to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It all depends on how you move them. If you just copy/paste the macro text
from one workbook to another, the shortcuts may not follow. You should export the macro to a file and then import the macro to the new workbook. Try exporting a short-cut assigned macro to your desktop. A .bas file will result. Examine the .bas file in NotePad and you should see the short-cut reference. -- Gary''s Student - gsnu200759 "Roger Converse" wrote: So I created a few macros that run on shortcut keys. Somehow, I moved them to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for the response. Well, since I record and don't write my own
macros, the code behind them just showed up in modules. I tried moving evrything into module 1 thinking that there would be no reason to have a bunch of modules that just housed one macro. I never really tried to copy from one workbook to another workbook. When I exported the module to my desktop and received the .bas file, I see the following (which I can also see in editor): Sub PvtTbl() ' PvtTbl Macro ' Macro recorded 11/27/2007 by Roger Converse ' Keyboard Shortcut: Ctrl+p That is how all the macros I have created look, so I am not sure as to what the issue is now. Thanks, Roger "Gary''s Student" wrote: It all depends on how you move them. If you just copy/paste the macro text from one workbook to another, the shortcuts may not follow. You should export the macro to a file and then import the macro to the new workbook. Try exporting a short-cut assigned macro to your desktop. A .bas file will result. Examine the .bas file in NotePad and you should see the short-cut reference. -- Gary''s Student - gsnu200759 "Roger Converse" wrote: So I created a few macros that run on shortcut keys. Somehow, I moved them to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I put:
Sub hello() MsgBox ("hello") End Sub in a module and assign CNTRL-e to it, and then export the module, the .bas file shows: Sub hello() Attribute hello.VB_ProcData.VB_Invoke_Func = "e\n14" MsgBox ("hello") End Sub -- Gary''s Student - gsnu200759 "Roger Converse" wrote: Thank you for the response. Well, since I record and don't write my own macros, the code behind them just showed up in modules. I tried moving evrything into module 1 thinking that there would be no reason to have a bunch of modules that just housed one macro. I never really tried to copy from one workbook to another workbook. When I exported the module to my desktop and received the .bas file, I see the following (which I can also see in editor): Sub PvtTbl() ' PvtTbl Macro ' Macro recorded 11/27/2007 by Roger Converse ' Keyboard Shortcut: Ctrl+p That is how all the macros I have created look, so I am not sure as to what the issue is now. Thanks, Roger "Gary''s Student" wrote: It all depends on how you move them. If you just copy/paste the macro text from one workbook to another, the shortcuts may not follow. You should export the macro to a file and then import the macro to the new workbook. Try exporting a short-cut assigned macro to your desktop. A .bas file will result. Examine the .bas file in NotePad and you should see the short-cut reference. -- Gary''s Student - gsnu200759 "Roger Converse" wrote: So I created a few macros that run on shortcut keys. Somehow, I moved them to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I exported, I do not show that.
Mine shows: Attribute VB_Name = "Module1" That is the only time that "Attribute" shows up. Do I need to have each short cut key controlled macro inits own module? Thank you, Roger "Gary''s Student" wrote: If I put: Sub hello() MsgBox ("hello") End Sub in a module and assign CNTRL-e to it, and then export the module, the .bas file shows: Sub hello() Attribute hello.VB_ProcData.VB_Invoke_Func = "e\n14" MsgBox ("hello") End Sub -- Gary''s Student - gsnu200759 "Roger Converse" wrote: Thank you for the response. Well, since I record and don't write my own macros, the code behind them just showed up in modules. I tried moving evrything into module 1 thinking that there would be no reason to have a bunch of modules that just housed one macro. I never really tried to copy from one workbook to another workbook. When I exported the module to my desktop and received the .bas file, I see the following (which I can also see in editor): Sub PvtTbl() ' PvtTbl Macro ' Macro recorded 11/27/2007 by Roger Converse ' Keyboard Shortcut: Ctrl+p That is how all the macros I have created look, so I am not sure as to what the issue is now. Thanks, Roger "Gary''s Student" wrote: It all depends on how you move them. If you just copy/paste the macro text from one workbook to another, the shortcuts may not follow. You should export the macro to a file and then import the macro to the new workbook. Try exporting a short-cut assigned macro to your desktop. A .bas file will result. Examine the .bas file in NotePad and you should see the short-cut reference. -- Gary''s Student - gsnu200759 "Roger Converse" wrote: So I created a few macros that run on shortcut keys. Somehow, I moved them to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Sean,
I created a small macro and then exported to a .bas file and see the attribute stuff that appears. Attribute VB_Name = "Module2" Sub Macro4() Attribute Macro4.VB_Description = "Macro recorded 11/29/2007 by Roger Converse" Attribute Macro4.VB_ProcData.VB_Invoke_Func = "i\n14" ' ' Macro4 Macro ' Macro recorded 11/29/2007 by Roger Converse ' ' Keyboard Shortcut: Ctrl+i ' Cells.Select Selection.ColumnWidth = 62.14 Selection.Rows.AutoFit Selection.Columns.AutoFit Range("A1").Select End Sub I can't seem to apply this to my module though. So if I just try to copy and paste that into my module 1, I get a compile error on the word Attribute. Any suggestions on how I can make this work? Thank you, Roger "Roger Converse" wrote: When I exported, I do not show that. Mine shows: Attribute VB_Name = "Module1" That is the only time that "Attribute" shows up. Do I need to have each short cut key controlled macro inits own module? Thank you, Roger "Gary''s Student" wrote: If I put: Sub hello() MsgBox ("hello") End Sub in a module and assign CNTRL-e to it, and then export the module, the .bas file shows: Sub hello() Attribute hello.VB_ProcData.VB_Invoke_Func = "e\n14" MsgBox ("hello") End Sub -- Gary''s Student - gsnu200759 "Roger Converse" wrote: Thank you for the response. Well, since I record and don't write my own macros, the code behind them just showed up in modules. I tried moving evrything into module 1 thinking that there would be no reason to have a bunch of modules that just housed one macro. I never really tried to copy from one workbook to another workbook. When I exported the module to my desktop and received the .bas file, I see the following (which I can also see in editor): Sub PvtTbl() ' PvtTbl Macro ' Macro recorded 11/27/2007 by Roger Converse ' Keyboard Shortcut: Ctrl+p That is how all the macros I have created look, so I am not sure as to what the issue is now. Thanks, Roger "Gary''s Student" wrote: It all depends on how you move them. If you just copy/paste the macro text from one workbook to another, the shortcuts may not follow. You should export the macro to a file and then import the macro to the new workbook. Try exporting a short-cut assigned macro to your desktop. A .bas file will result. Examine the .bas file in NotePad and you should see the short-cut reference. -- Gary''s Student - gsnu200759 "Roger Converse" wrote: So I created a few macros that run on shortcut keys. Somehow, I moved them to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Edited prior post.
"Roger Converse" wrote: I created a small macro and then exported to a .bas file and see the attribute stuff that appears. Attribute VB_Name = "Module2" Sub Macro4() Attribute Macro4.VB_Description = "Macro recorded 11/29/2007 by Roger Converse" Attribute Macro4.VB_ProcData.VB_Invoke_Func = "i\n14" ' ' Macro4 Macro ' Macro recorded 11/29/2007 by Roger Converse ' ' Keyboard Shortcut: Ctrl+i ' Cells.Select Selection.ColumnWidth = 62.14 Selection.Rows.AutoFit Selection.Columns.AutoFit Range("A1").Select End Sub I can't seem to apply this to my module though. So if I just try to copy and paste that into my module 1, I get a compile error on the word Attribute. Any suggestions on how I can make this work? Thank you, Roger "Roger Converse" wrote: When I exported, I do not show that. Mine shows: Attribute VB_Name = "Module1" That is the only time that "Attribute" shows up. Do I need to have each short cut key controlled macro inits own module? Thank you, Roger "Gary''s Student" wrote: If I put: Sub hello() MsgBox ("hello") End Sub in a module and assign CNTRL-e to it, and then export the module, the .bas file shows: Sub hello() Attribute hello.VB_ProcData.VB_Invoke_Func = "e\n14" MsgBox ("hello") End Sub -- Gary''s Student - gsnu200759 "Roger Converse" wrote: Thank you for the response. Well, since I record and don't write my own macros, the code behind them just showed up in modules. I tried moving evrything into module 1 thinking that there would be no reason to have a bunch of modules that just housed one macro. I never really tried to copy from one workbook to another workbook. When I exported the module to my desktop and received the .bas file, I see the following (which I can also see in editor): Sub PvtTbl() ' PvtTbl Macro ' Macro recorded 11/27/2007 by Roger Converse ' Keyboard Shortcut: Ctrl+p That is how all the macros I have created look, so I am not sure as to what the issue is now. Thanks, Roger "Gary''s Student" wrote: It all depends on how you move them. If you just copy/paste the macro text from one workbook to another, the shortcuts may not follow. You should export the macro to a file and then import the macro to the new workbook. Try exporting a short-cut assigned macro to your desktop. A .bas file will result. Examine the .bas file in NotePad and you should see the short-cut reference. -- Gary''s Student - gsnu200759 "Roger Converse" wrote: So I created a few macros that run on shortcut keys. Somehow, I moved them to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gary's Student:
Thank you for your assistance. I was able to take the information you provided and figure out a way to get my shortcut keys back in business. FYI - What I ended up doing was copying each macro to a .bas file and then manually setting the Attirbutes to the short cut key (based on your example) that I wanted and then re-imported the macro into their own modules. It is working now, so my fingers are crossed that they will continue to do so. So, every module contains one macro whose heading (when exported) looks like this: Attribute VB_Name = "Module1" Sub macOpenPO() Attribute macOpenPO.VB_Description = "Macro recorded 11/29/2007 by Roger Converse" Attribute macOpenPO.VB_ProcData.VB_Invoke_Func = "o\n14" I would imagine you could do something like below, but did not try: Attribute VB_Name = "Module1" Sub macOpenPO() Attribute macOpenPO.VB_Description = "Macro recorded 11/29/2007 by Roger Converse" Attribute macOpenPO.VB_ProcData.VB_Invoke_Func = "o\n14" .....rest of macro Sub macLow_Stock() Attribute macLow_Stock.VB_Description = "Macro recorded 11/29/2007 by Roger Converse" Attribute macLow_Stock.VB_ProcData.VB_Invoke_Func = "l\n14" .....rest of macro Thank you for the assistance! Without it, I would still be stuck. Thank you, Roger "Roger Converse" wrote: Edited prior post. "Roger Converse" wrote: I created a small macro and then exported to a .bas file and see the attribute stuff that appears. Attribute VB_Name = "Module2" Sub Macro4() Attribute Macro4.VB_Description = "Macro recorded 11/29/2007 by Roger Converse" Attribute Macro4.VB_ProcData.VB_Invoke_Func = "i\n14" ' ' Macro4 Macro ' Macro recorded 11/29/2007 by Roger Converse ' ' Keyboard Shortcut: Ctrl+i ' Cells.Select Selection.ColumnWidth = 62.14 Selection.Rows.AutoFit Selection.Columns.AutoFit Range("A1").Select End Sub I can't seem to apply this to my module though. So if I just try to copy and paste that into my module 1, I get a compile error on the word Attribute. Any suggestions on how I can make this work? Thank you, Roger "Roger Converse" wrote: When I exported, I do not show that. Mine shows: Attribute VB_Name = "Module1" That is the only time that "Attribute" shows up. Do I need to have each short cut key controlled macro inits own module? Thank you, Roger "Gary''s Student" wrote: If I put: Sub hello() MsgBox ("hello") End Sub in a module and assign CNTRL-e to it, and then export the module, the .bas file shows: Sub hello() Attribute hello.VB_ProcData.VB_Invoke_Func = "e\n14" MsgBox ("hello") End Sub -- Gary''s Student - gsnu200759 "Roger Converse" wrote: Thank you for the response. Well, since I record and don't write my own macros, the code behind them just showed up in modules. I tried moving evrything into module 1 thinking that there would be no reason to have a bunch of modules that just housed one macro. I never really tried to copy from one workbook to another workbook. When I exported the module to my desktop and received the .bas file, I see the following (which I can also see in editor): Sub PvtTbl() ' PvtTbl Macro ' Macro recorded 11/27/2007 by Roger Converse ' Keyboard Shortcut: Ctrl+p That is how all the macros I have created look, so I am not sure as to what the issue is now. Thanks, Roger "Gary''s Student" wrote: It all depends on how you move them. If you just copy/paste the macro text from one workbook to another, the shortcuts may not follow. You should export the macro to a file and then import the macro to the new workbook. Try exporting a short-cut assigned macro to your desktop. A .bas file will result. Examine the .bas file in NotePad and you should see the short-cut reference. -- Gary''s Student - gsnu200759 "Roger Converse" wrote: So I created a few macros that run on shortcut keys. Somehow, I moved them to a place where the shortcut keys aren't recognized. I can still run the macros via menu options, but don't have the "ctlr + button" control that I used to. Anyone else come across this issue? Thanks, Roger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Short Macro | Excel Discussion (Misc queries) | |||
Please Help with Short Macro | Excel Programming | |||
ZED - Need a short macro fix | Excel Discussion (Misc queries) | |||
Onkey vs Macro Short cut key | Excel Discussion (Misc queries) | |||
Macro short cut key | Excel Programming |