ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Short Cut Key Issue (https://www.excelbanter.com/excel-programming/401921-macro-short-cut-key-issue.html)

Roger Converse[_2_]

Macro Short Cut Key Issue
 
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

Gary''s Student

Macro Short Cut Key Issue
 
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


Roger Converse[_2_]

Macro Short Cut Key Issue
 
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


Gary''s Student

Macro Short Cut Key Issue
 
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


Roger Converse[_2_]

Macro Short Cut Key Issue
 
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


Roger Converse[_2_]

Macro Short Cut Key Issue
 
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


Roger Converse[_2_]

Macro Short Cut Key Issue
 
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


Roger Converse[_2_]

Macro Short Cut Key Issue
 
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



All times are GMT +1. The time now is 02:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com